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
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 @@
* the other side
*/
if (errno_copy == THRIFT_ECONNRESET) {
- close();
return false;
}
#endif
@@ -653,7 +652,6 @@
if (errno_copy == THRIFT_EPIPE || errno_copy == THRIFT_ECONNRESET
|| errno_copy == THRIFT_ENOTCONN) {
- close();
throw TTransportException(TTransportException::NOT_OPEN, "write() send()", errno_copy);
}