Use semaphores to keep track of proxy connections

This commit is contained in:
2023-01-05 22:51:30 +01:00
parent 993cb65724
commit 950bf19331
3 changed files with 50 additions and 17 deletions

View File

@ -26,13 +26,13 @@ void proxy_handler_func(client_ctx_t *ctx) {
respond(ctx);
if (ret == 1) {
ctx->proxy->in_use = 0;
proxy_unlock_ctx(ctx->proxy);
ctx->proxy = NULL;
} else if (ctx->use_proxy == 0) {
proxy_close(ctx->proxy);
} else if (ctx->use_proxy == 1) {
proxy_handler_2(ctx);
ctx->proxy->in_use = 0;
proxy_unlock_ctx(ctx->proxy);
ctx->proxy = NULL;
} else if (ctx->use_proxy == 2) {
// WebSocket