THRIFT-1314. cpp: add TProcessorFactory
Patch: Adam Simpkins
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1164190 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/server/TSimpleServer.cpp b/lib/cpp/src/server/TSimpleServer.cpp
index 229261f..b13b976 100644
--- a/lib/cpp/src/server/TSimpleServer.cpp
+++ b/lib/cpp/src/server/TSimpleServer.cpp
@@ -87,6 +87,10 @@
break;
}
+ // Get the processor
+ shared_ptr<TProcessor> processor = getProcessor(inputProtocol,
+ outputProtocol, client);
+
void* connectionContext = NULL;
if (eventHandler_ != NULL) {
connectionContext = eventHandler_->createContext(inputProtocol, outputProtocol);
@@ -96,8 +100,9 @@
if (eventHandler_ != NULL) {
eventHandler_->processContext(connectionContext, client);
}
- if (!processor_->process(inputProtocol, outputProtocol, connectionContext) ||
- // Peek ahead, is the remote side closed?
+ if (!processor->process(inputProtocol, outputProtocol,
+ connectionContext) ||
+ // Peek ahead, is the remote side closed?
!inputProtocol->getTransport()->peek()) {
break;
}