1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

log client IP of well-wishers

Although getting a million of these doesn't make any trouble for lws, the
source should be logged.
This commit is contained in:
Andy Green 2018-09-02 06:51:16 +08:00
parent fff8daa898
commit 1665df4642

View file

@ -1745,7 +1745,11 @@ lws_http_transaction_completed(struct lws *wsi)
lws_access_log(wsi);
if (!wsi->hdr_parsing_completed) {
lwsl_notice("%s: ignoring, ah parsing incomplete\n", __func__);
char peer[64];
lws_get_peer_simple(wsi, peer, sizeof(peer) - 1);
peer[sizeof(peer) - 1] = '\0';
lwsl_notice("%s: (from %s) ignoring, ah parsing incomplete\n",
__func__, peer);
return 0;
}