mirror of
https://github.com/shadowsocks/shadowsocks-libev.git
synced 2026-11-11 08:53:55 +00:00
Update local.c
This commit is contained in:
+3
-3
@@ -382,7 +382,7 @@ server_handshake(EV_P_ ev_io *w, buffer_t *buf)
|
||||
abuf->len += in_addr_len + 2;
|
||||
|
||||
if (acl || verbose) {
|
||||
uint16_t p = load16_be(buf->data + request_len + in_addr_len);
|
||||
uint16_t p = ntohs(*(uint16_t*)(buf->data + request_len + in_addr_len));
|
||||
if (!inet_ntop(AF_INET, (const void *)(buf->data + request_len),
|
||||
ip, INET_ADDRSTRLEN)) {
|
||||
LOGI("inet_ntop(AF_INET): %s", strerror(errno));
|
||||
@@ -400,7 +400,7 @@ server_handshake(EV_P_ ev_io *w, buffer_t *buf)
|
||||
abuf->len += name_len + 2;
|
||||
|
||||
if (acl || verbose) {
|
||||
uint16_t p = load16_be(buf->data + request_len + 1 + name_len);
|
||||
uint16_t p = ntohs(*(uint16_t*)(buf->data + request_len + 1 + name_len));
|
||||
memcpy(host, buf->data + request_len + 1, name_len);
|
||||
host[name_len] = '\0';
|
||||
sprintf(port, "%d", p);
|
||||
@@ -414,7 +414,7 @@ server_handshake(EV_P_ ev_io *w, buffer_t *buf)
|
||||
abuf->len += in6_addr_len + 2;
|
||||
|
||||
if (acl || verbose) {
|
||||
uint16_t p = load16_be(buf->data + request_len + in6_addr_len);
|
||||
uint16_t p = ntohs(*(uint16_t*)(buf->data + request_len + in6_addr_len));
|
||||
if (!inet_ntop(AF_INET6, (const void *)(buf->data + request_len),
|
||||
ip, INET6_ADDRSTRLEN)) {
|
||||
LOGI("inet_ntop(AF_INET6): %s", strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user