Thrift-1502:TSimpleServer::serve(): Do not print out error message if server was...
authorJake Farrell <jfarrell@apache.org>
Fri, 27 Jan 2012 04:32:17 +0000 (04:32 +0000)
committerJake Farrell <jfarrell@apache.org>
Fri, 27 Jan 2012 04:32:17 +0000 (04:32 +0000)
Client: cpp
Patch: Vibhav Sreekanti

Print msg on TSimpleServer stop.

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1236523 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/src/server/TSimpleServer.cpp

index b13b976..5def0e4 100644 (file)
@@ -68,8 +68,10 @@ void TSimpleServer::serve() {
       if (inputTransport != NULL) { inputTransport->close(); }
       if (outputTransport != NULL) { outputTransport->close(); }
       if (client != NULL) { client->close(); }
-      string errStr = string("TServerTransport died on accept: ") + ttx.what();
-      GlobalOutput(errStr.c_str());
+      if (!stop_ || ttx.getType() != TTransportException::INTERRUPTED) {
+          string errStr = string("TServerTransport died on accept: ") + ttx.what();
+          GlobalOutput(errStr.c_str());
+      }
       continue;
     } catch (TException& tx) {
       if (inputTransport != NULL) { inputTransport->close(); }