Skip to content

Commit

Permalink
test server log LWS_CALLBACK_HTTP
Browse files Browse the repository at this point in the history
Signed-off-by: Andy Green <andy.green@linaro.org>
  • Loading branch information
Andy Green committed Feb 25, 2016
1 parent d61bed3 commit a110180
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test-server/test-server-http.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ int callback_http(struct lws *wsi, enum lws_callback_reasons reason, void *user,
lwsl_notice("URI Arg %d: %s\n", ++n, buf);
}
}

{
char name[100], rip[50];
lws_get_peer_addresses(wsi, lws_get_socket_fd(wsi), name,
sizeof(name), rip, sizeof(rip));
sprintf(buf, "%s (%s)", name, rip);
lwsl_notice("HTTP connect from %s\n", buf);
}

if (len < 1) {
lws_return_http_status(wsi,
HTTP_STATUS_BAD_REQUEST, NULL);
Expand Down

0 comments on commit a110180

Please sign in to comment.