chenBright commented on code in PR #3749:
URL: https://github.com/apache/brpc/pull/3749#discussion_r4584967942


##########
test/brpc_http_rpc_protocol_unittest.cpp:
##########
@@ -2285,6 +2287,161 @@ TEST_F(HttpTest, 
http2_deferred_response_notify_registration_failure_resets_stre
     EXPECT_EQ(0, bthread_id_error(dummy_id, 0));
 }
 
+TEST(Http2FlowControlTest, oversized_body_returns_connection_window) {
+    brpc::GlobalInitializeOrDie();
+    GFLAGS_NAMESPACE::FlagSaver flag_saver;
+    brpc::FLAGS_max_body_size = 4;
+
+    for (bool client_side : {false, true}) {
+        SCOPED_TRACE(client_side);
+        int fds[2];
+        ASSERT_EQ(0, pipe(fds));
+        butil::fd_guard read_fd(fds[0]);
+        brpc::SocketOptions options;
+        options.fd = fds[1];
+        if (client_side) {
+            options.user = brpc::get_client_side_messenger();
+        }
+        brpc::SocketId id;
+        ASSERT_EQ(0, brpc::Socket::Create(options, &id));

Review Comment:
   Fixed in a8dd380e8f1cc7cebb79cb5ce36ee6ee5544915f. The pipe's write end is 
now managed by `butil::fd_guard`, and ownership is released only after 
`Socket::Create()` succeeds. This ensures the descriptor is closed if creation 
fails.



-- 
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