Copilot commented on code in PR #3693:
URL: https://github.com/apache/brpc/pull/3693#discussion_r4425572147


##########
src/brpc/socket.h:
##########
@@ -317,7 +318,7 @@ struct SocketOptions {
 
     // Socket keepalive related options.
     // Refer to `SocketKeepaliveOptions' for details.
-    std::shared_ptr<SocketKeepaliveOptions> keepalive_options;
+    butil::optional<SocketKeepaliveOptions> keepalive_options;

Review Comment:
   Changing this public `SocketOptions` member from 
`std::shared_ptr<SocketKeepaliveOptions>` to 
`butil::optional<SocketKeepaliveOptions>` is a source- and ABI-breaking API 
change: existing callers assigning `std::make_shared`, comparing with 
`nullptr`, or relying on shared ownership will no longer compile or will have 
an incompatible layout. The PR metadata says no backward-compatibility break; 
keep the public type stable and perform the required deep copy when 
storing/constructing sub-socket options instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to