You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@thrift.apache.org by dr...@apache.org on 2010/03/09 06:19:41 UTC

svn commit: r920671 - /incubator/thrift/trunk/lib/cpp/src/transport/TSocket.cpp

Author: dreiss
Date: Tue Mar  9 05:19:41 2010
New Revision: 920671

URL: http://svn.apache.org/viewvc?rev=920671&view=rev
Log:
cpp: Fix max TCP port number

Modified:
    incubator/thrift/trunk/lib/cpp/src/transport/TSocket.cpp

Modified: incubator/thrift/trunk/lib/cpp/src/transport/TSocket.cpp
URL: http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/cpp/src/transport/TSocket.cpp?rev=920671&r1=920670&r2=920671&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/cpp/src/transport/TSocket.cpp (original)
+++ incubator/thrift/trunk/lib/cpp/src/transport/TSocket.cpp Tue Mar  9 05:19:41 2010
@@ -230,7 +230,7 @@ void TSocket::open() {
   }
 
   // Validate port number
-  if (port_ < 0 || port_ > 65536) {
+  if (port_ < 0 || port_ > 0xFFFF) {
     throw TTransportException(TTransportException::NOT_OPEN, "Specified port is invalid");
   }
 
@@ -238,7 +238,7 @@ void TSocket::open() {
   res = NULL;
   res0 = NULL;
   int error;
-  char port[sizeof("65536")];
+  char port[sizeof("65535")];
   std::memset(&hints, 0, sizeof(hints));
   hints.ai_family = PF_UNSPEC;
   hints.ai_socktype = SOCK_STREAM;