diff --git a/src/net/tools/naive/socks5_server_socket.cc b/src/net/tools/naive/socks5_server_socket.cc index 936d32b46f..d7d691b0ca 100644 --- a/src/net/tools/naive/socks5_server_socket.cc +++ b/src/net/tools/naive/socks5_server_socket.cc @@ -20,14 +20,20 @@ namespace net { -const unsigned int Socks5ServerSocket::kGreetReadHeaderSize = 2; -const unsigned int Socks5ServerSocket::kReadHeaderSize = 5; -const char Socks5ServerSocket::kSOCKS5Version = '\x05'; -const char Socks5ServerSocket::kSOCKS5Reserved = '\x00'; -const char Socks5ServerSocket::kAuthMethodNone = '\x00'; -const char Socks5ServerSocket::kAuthMethodNoAcceptable = '\xff'; -const char Socks5ServerSocket::kReplySuccess = '\x00'; -const char Socks5ServerSocket::kReplyCommandNotSupported = '\x07'; +enum SocksCommandType { + kCommandConnect = 0x01, + kCommandBind = 0x02, + kCommandUDPAssociate = 0x03, +}; + +static constexpr unsigned int kGreetReadHeaderSize = 2; +static constexpr unsigned int kReadHeaderSize = 5; +static constexpr char kSOCKS5Version = '\x05'; +static constexpr char kSOCKS5Reserved = '\x00'; +static constexpr char kAuthMethodNone = '\x00'; +static constexpr char kAuthMethodNoAcceptable = '\xff'; +static constexpr char kReplySuccess = '\x00'; +static constexpr char kReplyCommandNotSupported = '\x07'; static_assert(sizeof(struct in_addr) == 4, "incorrect system size of IPv4"); static_assert(sizeof(struct in6_addr) == 16, "incorrect system size of IPv6"); diff --git a/src/net/tools/naive/socks5_server_socket.h b/src/net/tools/naive/socks5_server_socket.h index 1f1a888c5d..988c233cf9 100644 --- a/src/net/tools/naive/socks5_server_socket.h +++ b/src/net/tools/naive/socks5_server_socket.h @@ -92,21 +92,6 @@ class Socks5ServerSocket : public StreamSocket { kEndPointResolvedIPv6 = 0x04, }; - enum SocksCommandType { - kCommandConnect = 0x01, - kCommandBind = 0x02, - kCommandUDPAssociate = 0x03, - }; - - static const unsigned int kGreetReadHeaderSize; - static const unsigned int kReadHeaderSize; - static const char kSOCKS5Version; - static const char kSOCKS5Reserved; - static const char kAuthMethodNone; - static const char kAuthMethodNoAcceptable; - static const char kReplySuccess; - static const char kReplyCommandNotSupported; - void DoCallback(int result); void OnIOComplete(int result); void OnReadWriteComplete(CompletionOnceCallback callback, int result);