handler: no need to parse trailer when processing request
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.master
parent
db1e0f1799
commit
87ece3976b
|
@ -59,11 +59,11 @@ static bool sanitize(const char *uri)
|
||||||
|
|
||||||
int tip_client_state_process_payload(struct tip_client *cli)
|
int tip_client_state_process_payload(struct tip_client *cli)
|
||||||
{
|
{
|
||||||
const char *trailer, *x_redirect;
|
|
||||||
bool allow_redirect = true;
|
bool allow_redirect = true;
|
||||||
char _uri[256], *uri = _uri;
|
char _uri[256], *uri = _uri;
|
||||||
char allow_redirect_str[5];
|
char allow_redirect_str[5];
|
||||||
char path[PATH_MAX + 1];
|
char path[PATH_MAX + 1];
|
||||||
|
const char *x_redirect;
|
||||||
char *chunk = NULL;
|
char *chunk = NULL;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
int err;
|
int err;
|
||||||
|
@ -94,8 +94,6 @@ int tip_client_state_process_payload(struct tip_client *cli)
|
||||||
!strncmp(allow_redirect_str, "off", strlen("off")))
|
!strncmp(allow_redirect_str, "off", strlen("off")))
|
||||||
allow_redirect = false;
|
allow_redirect = false;
|
||||||
|
|
||||||
trailer = strstr(cli->buf, "\r\n\r\n");
|
|
||||||
|
|
||||||
if (!sanitize(uri))
|
if (!sanitize(uri))
|
||||||
return tip_client_method_not_found(cli);
|
return tip_client_method_not_found(cli);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue