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


THRIFT-4161: TNonblockingServer: Fix using uninitialized event_
Client: cpp

When there are more than one IO threads, and we have failed to notify
one IO threads, then we have to close the connection. But the event_
in that connection isn't initialized. We should use setIdle() instead.

This closes #1216


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

Branch: refs/heads/master
Commit: bf42d55189d9d8160a061cc3a7020324111942bb
Parents: d4fa706
Author: Changli Gao <xiao...@gmail.com>
Authored: Mon Mar 20 14:29:07 2017 +0800
Committer: James E. King, III <jk...@apache.org>
Committed: Sun Apr 2 23:30:04 2017 -0400

----------------------------------------------------------------------
 lib/cpp/src/thrift/server/TNonblockingServer.cpp | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/thrift/blob/bf42d551/lib/cpp/src/thrift/server/TNonblockingServer.cpp
----------------------------------------------------------------------
diff --git a/lib/cpp/src/thrift/server/TNonblockingServer.cpp 
b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
index c03327d..905c5d2 100644
--- a/lib/cpp/src/thrift/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/thrift/server/TNonblockingServer.cpp
@@ -821,10 +821,7 @@ void TNonblockingServer::TConnection::setFlags(short 
eventFlags) {
  * Closes a connection
  */
 void TNonblockingServer::TConnection::close() {
-  if (eventFlags_ && event_del(&event_) == -1) {
-    GlobalOutput.perror("TConnection::close() event_del", 
THRIFT_GET_SOCKET_ERROR);
-    return;
-  }
+  setIdle();
 
   if (serverEventHandler_) {
     serverEventHandler_->deleteContext(connectionContext_, inputProtocol_, 
outputProtocol_);

Reply via email to