Repository: thrift
Updated Branches:
  refs/heads/master bf42d5518 -> 7e7a1a7c1


TSocket: Don't close connections when failing to read/write
Client: cpp

Sockets maybe registered to a event base of libevent, so the
following epoll_ctl(2) may fail due to EBADF, or may
delete other sockets. Chaos occurs.

This closes #1217


Project: http://git-wip-us.apache.org/repos/asf/thrift/repo
Commit: http://git-wip-us.apache.org/repos/asf/thrift/commit/7e7a1a7c
Tree: http://git-wip-us.apache.org/repos/asf/thrift/tree/7e7a1a7c
Diff: http://git-wip-us.apache.org/repos/asf/thrift/diff/7e7a1a7c

Branch: refs/heads/master
Commit: 7e7a1a7c1027d30294da24e5d3f299ff90313c34
Parents: bf42d55
Author: Changli Gao <xiao...@gmail.com>
Authored: Mon Mar 20 14:36:57 2017 +0800
Committer: James E. King, III <jk...@apache.org>
Committed: Sun Apr 2 23:37:14 2017 -0400

----------------------------------------------------------------------
 lib/cpp/src/thrift/transport/TSocket.cpp | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/7e7a1a7c/lib/cpp/src/thrift/transport/TSocket.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/transport/TSocket.cpp 
b/lib/cpp/src/thrift/transport/TSocket.cpp
index 21a9aca..8f0f06c 100644
--- a/lib/cpp/src/thrift/transport/TSocket.cpp
+++ b/lib/cpp/src/thrift/transport/TSocket.cpp
@@ -217,7 +217,6 @@ bool TSocket::peek() {
      * the other side
      */
     if (errno_copy == THRIFT_ECONNRESET) {
-      close();
       return false;
     }
 #endif
@@ -653,7 +652,6 @@ uint32_t TSocket::write_partial(const uint8_t* buf, 
uint32_t len) {
 
     if (errno_copy == THRIFT_EPIPE || errno_copy == THRIFT_ECONNRESET
         || errno_copy == THRIFT_ENOTCONN) {
-      close();
       throw TTransportException(TTransportException::NOT_OPEN, "write() 
send()", errno_copy);
     }
 

Reply via email to