From bd8e71e83d8f3256ffe8060e04a20746ff75dc11 Mon Sep 17 00:00:00 2001 From: Lorenz Stechauner Date: Sat, 1 Jul 2023 20:13:51 +0200 Subject: [PATCH] Rename fcgi_cnx to fcgi_ctx in client struct --- src/worker/fastcgi_frame_handler.c | 4 ++-- src/worker/fastcgi_handler.c | 18 +++++++++--------- src/worker/func.h | 2 +- src/worker/request_handler.c | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/worker/fastcgi_frame_handler.c b/src/worker/fastcgi_frame_handler.c index e87b3da..6a0d4d5 100644 --- a/src/worker/fastcgi_frame_handler.c +++ b/src/worker/fastcgi_frame_handler.c @@ -43,7 +43,7 @@ int fastcgi_handle_connection(client_ctx_t *ctx, fastcgi_cnx_t **cnx) { a->closed = 0; a->client = ctx; memcpy(&a->cnx, *cnx, sizeof(fastcgi_cnx_t)); - ctx->fcgi_cnx = a; + ctx->fcgi_ctx = a; fastcgi_handle_frame(a); *cnx = &a->cnx; @@ -66,7 +66,7 @@ void fastcgi_close(fastcgi_ctx_t *ctx) { debug("Closing FastCGI connection"); fastcgi_close_cnx(&ctx->cnx); - ctx->client->fcgi_cnx = NULL; + ctx->client->fcgi_ctx = NULL; free(ctx); errno = 0; } diff --git a/src/worker/fastcgi_handler.c b/src/worker/fastcgi_handler.c index 3a5372a..15248ce 100644 --- a/src/worker/fastcgi_handler.c +++ b/src/worker/fastcgi_handler.c @@ -32,7 +32,7 @@ void fastcgi_handler_func(client_ctx_t *ctx) { case 2: break; } } else { - fastcgi_close(ctx->fcgi_cnx); + fastcgi_close(ctx->fcgi_ctx); } } @@ -148,9 +148,9 @@ static int fastcgi_handler_1(client_ctx_t *ctx, fastcgi_cnx_t **fcgi_cnx) { } static void fastcgi_next_cb(chunk_ctx_t *ctx) { - if(ctx->client->fcgi_cnx) { - fastcgi_close(ctx->client->fcgi_cnx); - ctx->client->fcgi_cnx = NULL; + if(ctx->client->fcgi_ctx) { + fastcgi_close(ctx->client->fcgi_ctx); + ctx->client->fcgi_ctx = NULL; } fastcgi_handle(ctx->client); @@ -163,9 +163,9 @@ static void fastcgi_error_cb(chunk_ctx_t *ctx) { logger_set_prefix("[%s%*s%s]%s", BLD_STR, ADDRSTRLEN, ctx->client->req_host, CLR_STR, ctx->client->log_prefix); warning("Closing connection due to FastCGI error"); - if(ctx->client->fcgi_cnx) { - fastcgi_close(ctx->client->fcgi_cnx); - ctx->client->fcgi_cnx = NULL; + if(ctx->client->fcgi_ctx) { + fastcgi_close(ctx->client->fcgi_ctx); + ctx->client->fcgi_ctx = NULL; } tcp_close(ctx->client); @@ -181,8 +181,8 @@ static int fastcgi_handler_2(client_ctx_t *ctx, fastcgi_cnx_t *fcgi_cnx) { return 1; } else { fastcgi_send(fcgi_cnx, &ctx->socket); - fastcgi_close(ctx->fcgi_cnx); - ctx->fcgi_cnx = NULL; + fastcgi_close(ctx->fcgi_ctx); + ctx->fcgi_ctx = NULL; fastcgi_handle(ctx); return 2; } diff --git a/src/worker/func.h b/src/worker/func.h index 74eefed..b934df0 100644 --- a/src/worker/func.h +++ b/src/worker/func.h @@ -36,7 +36,7 @@ typedef struct { long content_length; char *msg_buf, *msg_buf_ptr, msg_content[1024]; proxy_ctx_t *proxy; - void *fcgi_cnx; + void *fcgi_ctx; } client_ctx_t; typedef struct { diff --git a/src/worker/request_handler.c b/src/worker/request_handler.c index 76b8284..fff42f9 100644 --- a/src/worker/request_handler.c +++ b/src/worker/request_handler.c @@ -49,7 +49,7 @@ static void init_ctx(client_ctx_t *ctx) { ctx->proxy = NULL; ctx->use_fastcgi = 0; ctx->chunks_transferred = 0; - ctx->fcgi_cnx = NULL; + ctx->fcgi_ctx = NULL; ctx->use_proxy = 0; ctx->ws_close = 0; ctx->proxy = NULL;