Since the buffer is constant, we set the length directly
[novacoin.git] / src / netbase.cpp
index 9bf5fe9..4699abf 100644 (file)
@@ -221,11 +221,9 @@ bool static Socks5(string strDest, uint16_t port, SOCKET& hSocket)
         CloseSocket(hSocket);
         return error("Hostname too long");
     }
-    char pszSocks5Init[] = "\5\1\0";
-    ssize_t nSize = sizeof(pszSocks5Init) - 1;
-
-    ssize_t ret = send(hSocket, pszSocks5Init, nSize, MSG_NOSIGNAL);
-    if (ret != nSize)
+    const char pszSocks5Init[] = "\5\1\0";
+        ssize_t ret = send(hSocket, pszSocks5Init, 3, MSG_NOSIGNAL);
+    if (ret != 3)
     {
         CloseSocket(hSocket);
         return error("Error sending to proxy");
@@ -1193,4 +1191,4 @@ bool CloseSocket(SOCKET& hSocket)
 #endif
     hSocket = INVALID_SOCKET;
     return ret != SOCKET_ERROR;
-}
\ No newline at end of file
+}