update num_clients and redirection only for large files
Skip num_clients and redirection update for small files.master
parent
cbcc71db72
commit
7a04638c32
|
@ -50,9 +50,10 @@ static void tip_client_release(struct ev_loop *loop, struct tip_client *cli)
|
||||||
free((void *)cli->path);
|
free((void *)cli->path);
|
||||||
|
|
||||||
if (cli->method == TIP_METHOD_GET) {
|
if (cli->method == TIP_METHOD_GET) {
|
||||||
num_clients--;
|
if (tip_client_large_file(cli)) {
|
||||||
if (tip_client_large_file(cli))
|
num_clients--;
|
||||||
tip_client_activate_pending();
|
tip_client_activate_pending();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
free(cli);
|
free(cli);
|
||||||
|
|
|
@ -107,13 +107,15 @@ int tip_client_state_process_payload(struct tip_client *cli)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
cli->allow_redirect = allow_redirect;
|
if (tip_client_large_file(cli)) {
|
||||||
|
cli->allow_redirect = allow_redirect;
|
||||||
|
|
||||||
num_clients++;
|
num_clients++;
|
||||||
if (tip_client_large_file(cli) && num_clients > max_clients) {
|
if (num_clients > max_clients) {
|
||||||
if (!tip_client_redirect(cli)) {
|
if (!tip_client_redirect(cli)) {
|
||||||
tip_client_pending(cli);
|
tip_client_pending(cli);
|
||||||
return 1;
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue