THRIFT: Nonblcoking bug fix
authorDavid Reiss <dreiss@apache.org>
Tue, 29 Apr 2008 00:29:43 +0000 (00:29 +0000)
committerDavid Reiss <dreiss@apache.org>
Tue, 29 Apr 2008 00:29:43 +0000 (00:29 +0000)
calling decrement with -1 even though param is an integer. Just made it clean by adding a decrement function

reviewed by: mcslee
revertable
test plan: ran on a test server

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

lib/cpp/src/server/TNonblockingServer.h

index 0c3c6d5..de2e43b 100644 (file)
@@ -158,8 +158,12 @@ class TNonblockingServer : public TServer {
     return eventBase_;
   }
 
-  void incrementNumConnections(size_t incr=1) {
-    numTConnections_ += incr;
+  void incrementNumConnections() {
+    ++numTConnections_;
+  }
+
+  void decrementNumConnections() {
+    --numTConnections_;
   }
 
   size_t getNumConnections() {
@@ -329,7 +333,7 @@ class TConnection {
   }
 
   ~TConnection() {
-    server_->incrementNumConnections(-1);
+    server_->decrementNumConnections();
   }
 
   // Initialize