(THRIFT-54) Remove "frameResponses" from TNonblockingServer
TNonblockingServer and TFramedTransport used to have the option to only
frame messages on one side of the communication. This capability was
removed from TFramedTransport because it was poorly implemented and not
useful. This change removes it from TNonblockingServer as well, and
removes references to it in some of the C++ test code.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@673791 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/server/TNonblockingServer.cpp
index cd7951d..8aec9d8 100644
--- a/lib/cpp/src/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/server/TNonblockingServer.cpp
@@ -297,20 +297,16 @@
// If the function call generated return data, then move into the send
// state and get going
+ // 4 bytes were reserved for frame size
if (writeBufferSize_ > 4) {
// Move into write state
writeBufferPos_ = 0;
socketState_ = SOCKET_SEND;
- if (server_->getFrameResponses()) {
- // Put the frame size into the write buffer
- int32_t frameSize = (int32_t)htonl(writeBufferSize_ - 4);
- memcpy(writeBuffer_, &frameSize, 4);
- } else {
- // Go straight into sending the result, do not frame it
- writeBufferPos_ = 4;
- }
+ // Put the frame size into the write buffer
+ int32_t frameSize = (int32_t)htonl(writeBufferSize_ - 4);
+ memcpy(writeBuffer_, &frameSize, 4);
// Socket into write mode
appState_ = APP_SEND_RESULT;
diff --git a/lib/cpp/src/server/TNonblockingServer.h b/lib/cpp/src/server/TNonblockingServer.h
index 9d426fa..9deaebd 100644
--- a/lib/cpp/src/server/TNonblockingServer.h
+++ b/lib/cpp/src/server/TNonblockingServer.h
@@ -49,9 +49,6 @@
// Port server runs on
int port_;
- // Whether to frame responses
- bool frameResponses_;
-
// For processing via thread pool, may be NULL
boost::shared_ptr<ThreadManager> threadManager_;
@@ -83,7 +80,6 @@
TServer(processor),
serverSocket_(-1),
port_(port),
- frameResponses_(true),
threadPoolProcessing_(false),
eventBase_(NULL),
numTConnections_(0) {}
@@ -95,7 +91,6 @@
TServer(processor),
serverSocket_(-1),
port_(port),
- frameResponses_(true),
threadManager_(threadManager),
eventBase_(NULL),
numTConnections_(0) {
@@ -116,7 +111,6 @@
TServer(processor),
serverSocket_(0),
port_(port),
- frameResponses_(true),
threadManager_(threadManager),
eventBase_(NULL),
numTConnections_(0) {
@@ -146,14 +140,6 @@
threadManager_->add(task);
}
- void setFrameResponses(bool frameResponses) {
- frameResponses_ = frameResponses;
- }
-
- bool getFrameResponses() const {
- return frameResponses_;
- }
-
event_base* getEventBase() const {
return eventBase_;
}