From 84a25639b36644a20591ad0b141476c6c7d261a6 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Wed, 28 Aug 2019 16:43:08 +0200 Subject: #915 add syslog debugging for HTTP request Display initial 32 bytes of the HTTP request. --- sources/ogAdmServer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sources/ogAdmServer.cpp b/sources/ogAdmServer.cpp index 75f0a2c..8362796 100644 --- a/sources/ogAdmServer.cpp +++ b/sources/ogAdmServer.cpp @@ -3991,6 +3991,10 @@ static int og_client_state_process_payload_rest(struct og_client *cli) json_t *root = NULL; int err = 0; + syslog(LOG_DEBUG, "%s:%hu %.32s ...\n", + inet_ntoa(cli->addr.sin_addr), + ntohs(cli->addr.sin_port), cli->buf); + if (!strncmp(cli->buf, "GET", strlen("GET"))) { method = OG_METHOD_GET; cmd = cli->buf + strlen("GET") + 2; @@ -4223,10 +4227,6 @@ static void og_client_read_cb(struct ev_loop *loop, struct ev_io *io, int events cli->state = OG_CLIENT_PROCESSING_REQUEST; /* fall through. */ case OG_CLIENT_PROCESSING_REQUEST: - syslog(LOG_DEBUG, "processing request from %s:%hu\n", - inet_ntoa(cli->addr.sin_addr), - ntohs(cli->addr.sin_port)); - if (cli->rest) ret = og_client_state_process_payload_rest(cli); else -- cgit v1.2.3-18-g5258