@@ -208,41 +208,46 @@ struct timeval MillisToTimeval(int64_t nTimeout)
208208}
209209
210210/* * SOCKS version */
211- enum SOCKSVersion: uint8_t {
211+ enum SOCKSVersion : uint8_t
212+ {
212213 SOCKS4 = 0x04 ,
213214 SOCKS5 = 0x05
214215};
215216
216217/* * Values defined for METHOD in RFC1928 */
217- enum SOCKS5Method: uint8_t {
218- NOAUTH = 0x00 , // !< No authentication required
219- GSSAPI = 0x01 , // !< GSSAPI
220- USER_PASS = 0x02 , // !< Username/password
218+ enum SOCKS5Method : uint8_t
219+ {
220+ NOAUTH = 0x00 , // !< No authentication required
221+ GSSAPI = 0x01 , // !< GSSAPI
222+ USER_PASS = 0x02 , // !< Username/password
221223 NO_ACCEPTABLE = 0xff , // !< No acceptable methods
222224};
223225
224226/* * Values defined for CMD in RFC1928 */
225- enum SOCKS5Command: uint8_t {
227+ enum SOCKS5Command : uint8_t
228+ {
226229 CONNECT = 0x01 ,
227230 BIND = 0x02 ,
228231 UDP_ASSOCIATE = 0x03
229232};
230233
231234/* * Values defined for REP in RFC1928 */
232- enum SOCKS5Reply: uint8_t {
233- SUCCEEDED = 0x00 , // !< Succeeded
234- GENFAILURE = 0x01 , // !< General failure
235- NOTALLOWED = 0x02 , // !< Connection not allowed by ruleset
236- NETUNREACHABLE = 0x03 , // !< Network unreachable
237- HOSTUNREACHABLE = 0x04 , // !< Network unreachable
238- CONNREFUSED = 0x05 , // !< Connection refused
239- TTLEXPIRED = 0x06 , // !< TTL expired
240- CMDUNSUPPORTED = 0x07 , // !< Command not supported
235+ enum SOCKS5Reply : uint8_t
236+ {
237+ SUCCEEDED = 0x00 , // !< Succeeded
238+ GENFAILURE = 0x01 , // !< General failure
239+ NOTALLOWED = 0x02 , // !< Connection not allowed by ruleset
240+ NETUNREACHABLE = 0x03 , // !< Network unreachable
241+ HOSTUNREACHABLE = 0x04 , // !< Network unreachable
242+ CONNREFUSED = 0x05 , // !< Connection refused
243+ TTLEXPIRED = 0x06 , // !< TTL expired
244+ CMDUNSUPPORTED = 0x07 , // !< Command not supported
241245 ATYPEUNSUPPORTED = 0x08 , // !< Address type not supported
242246};
243247
244248/* * Values defined for ATYPE in RFC1928 */
245- enum SOCKS5Atyp: uint8_t {
249+ enum SOCKS5Atyp : uint8_t
250+ {
246251 IPV4 = 0x01 ,
247252 DOMAINNAME = 0x03 ,
248253 IPV6 = 0x04 ,
@@ -269,7 +274,7 @@ static bool InterruptibleRecv(uint8_t *data, size_t len, int timeout, SOCKET &hS
269274 while (len > 0 && curTime < endTime)
270275 {
271276 // Optimistically try the recv first
272- ssize_t ret = recv (hSocket, (char *)data, len, 0 );
277+ ssize_t ret = recv (hSocket, (char *)data, len, 0 );
273278 if (ret > 0 )
274279 {
275280 len -= ret;
0 commit comments