do not shadow global redirect variable

master
tiptorrent development team 2021-09-17 00:34:02 +02:00
parent e46be236c7
commit dab82c806f
1 changed files with 3 additions and 3 deletions

View File

@ -57,8 +57,8 @@ int tip_client_state_process_payload(struct tip_client *cli)
const char *trailer, *x_redirect; const char *trailer, *x_redirect;
bool allow_redirect = true; bool allow_redirect = true;
char _uri[32], *uri = _uri; char _uri[32], *uri = _uri;
char allow_redirect_str[5];
char path[PATH_MAX + 1]; char path[PATH_MAX + 1];
char redirect[5];
struct stat st; struct stat st;
int err; int err;
@ -80,8 +80,8 @@ int tip_client_state_process_payload(struct tip_client *cli)
x_redirect = strstr(cli->buf, "X-Accept-Redirect: "); x_redirect = strstr(cli->buf, "X-Accept-Redirect: ");
if (x_redirect && if (x_redirect &&
sscanf(x_redirect, "X-Accept-Redirect: %4s", redirect) == 1 && sscanf(x_redirect, "X-Accept-Redirect: %4s", allow_redirect_str) == 1 &&
!strncmp(redirect, "off", strlen("off"))) !strncmp(allow_redirect_str, "off", strlen("off")))
allow_redirect = false; allow_redirect = false;
trailer = strstr(cli->buf, "\r\n\r\n"); trailer = strstr(cli->buf, "\r\n\r\n");