Fix ipv6 address format in log message

This commit is contained in:
Kim
2016-05-08 17:34:54 +08:00
committed by Max Lv
parent 285c62b8f3
commit 342bd3f776
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -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)) {