Index: src/OFTCPSocket+SOCKS5.m ================================================================== --- src/OFTCPSocket+SOCKS5.m +++ src/OFTCPSocket+SOCKS5.m @@ -30,12 +30,11 @@ /* Reference for static linking */ int _OFTCPSocket_SOCKS5_reference; static void -send_or_exception(OFTCPSocket *self, of_socket_t sock, char *buffer, - int length) +sendOrThrow(OFTCPSocket *self, of_socket_t sock, char *buffer, int length) { #ifndef OF_WINDOWS ssize_t bytesWritten; #else int bytesWritten; @@ -54,11 +53,11 @@ bytesWritten: bytesWritten errNo: 0]; } static void -recv_exact(OFTCPSocket *self, of_socket_t sock, char *buffer, int length) +recvExact(OFTCPSocket *self, of_socket_t sock, char *buffer, int length) { while (length > 0) { ssize_t ret = recv(sock, (void *)buffer, length, 0); if (ret < 0) @@ -83,13 +82,13 @@ if ([host UTF8StringLength] > 255) @throw [OFOutOfRangeException exception]; /* 5 1 0 -> no authentication */ - send_or_exception(self, _socket, request, 3); + sendOrThrow(self, _socket, request, 3); - recv_exact(self, _socket, reply, 2); + recvExact(self, _socket, reply, 2); if (reply[0] != 5 || reply[1] != 0) { [self close]; @throw [OFConnectionFailedException exceptionWithHost: host @@ -116,16 +115,16 @@ count: 2]; if ([connectRequest count] > INT_MAX) @throw [OFOutOfRangeException exception]; - send_or_exception(self, _socket, + sendOrThrow(self, _socket, [connectRequest items], (int)[connectRequest count]); objc_autoreleasePoolPop(pool); - recv_exact(self, _socket, reply, 4); + recvExact(self, _socket, reply, 4); if (reply[0] != 5 || reply[2] != 0) { [self close]; @throw [OFConnectionFailedException exceptionWithHost: host @@ -173,18 +172,18 @@ } /* Skip the rest of the reply */ switch (reply[3]) { case 1: /* IPv4 */ - recv_exact(self, _socket, reply, 4); + recvExact(self, _socket, reply, 4); break; case 3: /* Domain name */ - recv_exact(self, _socket, reply, 1); - recv_exact(self, _socket, reply, reply[0]); + recvExact(self, _socket, reply, 1); + recvExact(self, _socket, reply, reply[0]); break; case 4: /* IPv6 */ - recv_exact(self, _socket, reply, 16); + recvExact(self, _socket, reply, 16); break; default: [self close]; @throw [OFConnectionFailedException exceptionWithHost: host @@ -191,8 +190,8 @@ port: port socket: self errNo: EPROTONOSUPPORT]; } - recv_exact(self, _socket, reply, 2); + recvExact(self, _socket, reply, 2); } @end