Fix proxy unlocking

This commit is contained in:
2023-07-06 00:29:12 +02:00
parent 77f0eeda6d
commit c59977dada
2 changed files with 2 additions and 2 deletions

View File

@ -139,10 +139,9 @@ proxy_ctx_t *proxy_get_by_conf(host_config_t *conf) {
void proxy_unlock_ctx(proxy_ctx_t *ctx) {
int n = (int) ((ctx - proxies) / MAX_PROXY_CNX_PER_HOST);
int was_in_use = ctx->in_use;
ctx->in_use = 0;
ctx->client = NULL;
if (was_in_use) sem_post(&available[n]);
sem_post(&available[n]);
}
int proxy_request_header(http_req *req, sock *sock) {