1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-07-31 08:24:23 +03:00

Make client address available in mg_request_info also for IPv6 (see also issue #33)

This commit is contained in:
bel
2014-09-14 11:04:42 +02:00
parent ec902803d5
commit 154b80bb69
5 changed files with 13 additions and 9 deletions

View File

@ -49,7 +49,7 @@ void websocket_ready_handler(struct mg_connection *conn) {
break;
}
}
printf("\nNew websocket attached: %08lx:%u\n", rq->remote_ip, rq->remote_port);
printf("\nNew websocket attached: %s:%u\n", rq->remote_addr, rq->remote_port);
mg_unlock_context(ctx);
}
@ -66,7 +66,7 @@ static void websocket_done(tWebSockContext *ws_ctx, tWebSockInfo * wsock) {
break;
}
}
printf("\nClose websocket attached: %08lx:%u\n", mg_get_request_info(wsock->conn)->remote_ip, mg_get_request_info(wsock->conn)->remote_port);
printf("\nClose websocket attached: %s:%u\n", mg_get_request_info(wsock->conn)->remote_addr, mg_get_request_info(wsock->conn)->remote_port);
free(wsock);
}
}