From 87ece3976b3d68af2620f7b90ef8e10416abd231 Mon Sep 17 00:00:00 2001 From: OpenGnSys Support Team Date: Thu, 11 Jan 2024 12:43:22 +0100 Subject: handler: no need to parse trailer when processing request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need to parse HTTP header trailer in TIP_CLIENT_PROCESSING_REQUEST. src/handler.c:62:14: warning: variable ‘trailer’ set but not used [-Wunused-but-set-variable] 62 | const char *trailer, *x_redirect; | ^~~~~~~ tip_client_state_recv_hdr() already validates header trailer is present. --- src/handler.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/handler.c b/src/handler.c index bc8af39..a6617ca 100644 --- a/src/handler.c +++ b/src/handler.c @@ -59,11 +59,11 @@ static bool sanitize(const char *uri) int tip_client_state_process_payload(struct tip_client *cli) { - const char *trailer, *x_redirect; bool allow_redirect = true; char _uri[256], *uri = _uri; char allow_redirect_str[5]; char path[PATH_MAX + 1]; + const char *x_redirect; char *chunk = NULL; struct stat st; int err; @@ -94,8 +94,6 @@ int tip_client_state_process_payload(struct tip_client *cli) !strncmp(allow_redirect_str, "off", strlen("off"))) allow_redirect = false; - trailer = strstr(cli->buf, "\r\n\r\n"); - if (!sanitize(uri)) return tip_client_method_not_found(cli); -- cgit v1.2.3-18-g5258