Thrift-1502:TSimpleServer::serve(): Do not print out error message if server was stopped.
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
diff --git a/lib/cpp/src/server/TSimpleServer.cpp b/lib/cpp/src/server/TSimpleServer.cpp
index b13b976..5def0e4 100644
--- a/lib/cpp/src/server/TSimpleServer.cpp
+++ b/lib/cpp/src/server/TSimpleServer.cpp
@@ -68,8 +68,10 @@
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(); }