This is an automated email from the ASF dual-hosted git repository.

wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new 2c74ab51 Fix Socket check failed with invalid fd of Stream (#2776)
2c74ab51 is described below

commit 2c74ab51a2840ec475d036974b81a6ca86f7e7f6
Author: Bright Chen <chenguangmin...@foxmail.com>
AuthorDate: Mon Oct 7 14:47:45 2024 +0800

    Fix Socket check failed with invalid fd of Stream (#2776)
---
 src/brpc/socket.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/brpc/socket.cpp b/src/brpc/socket.cpp
index 0fcad203..0201a978 100644
--- a/src/brpc/socket.cpp
+++ b/src/brpc/socket.cpp
@@ -1548,7 +1548,9 @@ void Socket::CheckConnectedAndKeepWrite(int fd, int err, 
void* data) {
     butil::fd_guard sockfd(fd);
     WriteRequest* req = static_cast<WriteRequest*>(data);
     Socket* s = req->get_socket();
-    CHECK_GE(sockfd, 0);
+    if (NULL == s->_conn) {
+        CHECK_GE(sockfd, 0);
+    }
     if (err == 0 && s->CheckConnected(sockfd) == 0
         && s->ResetFileDescriptor(sockfd) == 0) {
         if (s->CreatedByConnect()) {


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to