Browse Source

Fix ipv6 address format in log message

pull/636/head
Kim 8 years ago
committed by Max Lv
parent
commit
342bd3f776
2 changed files with 8 additions and 2 deletions
  1. 5
      src/local.c
  2. 5
      src/server.c

5
src/local.c

@ -468,7 +468,10 @@ static void server_recv_cb(EV_P_ ev_io *w, int revents)
}
if (verbose) {
LOGI("connect to %s:%s", host, port);
if (request->atyp == 4)
LOGI("connect to [%s]:%s", host, port);
else
LOGI("connect to %s:%s", host, port);
}
if ((acl && (request->atyp == 1 || request->atyp == 4) && acl_match_ip(host))) {

5
src/server.c

@ -759,7 +759,10 @@ static void server_recv_cb(EV_P_ ev_io *w, int revents)
}
if (verbose) {
LOGI("connect to: %s:%d", host, ntohs(port));
if ((atyp & ADDRTYPE_MASK) == 4)
LOGI("connect to [%s]:%d", host, ntohs(port));
else
LOGI("connect to %s:%d", host, ntohs(port));
}
if (server->auth && !ss_check_hash(server->buf, server->chunk, server->d_ctx, BUF_SIZE)) {

Loading…
Cancel
Save