Rename fcgi_cnx to fcgi_ctx in client struct

This commit is contained in:
2023-07-01 20:13:51 +02:00
parent 9aaa28f1ca
commit bd8e71e83d
4 changed files with 13 additions and 13 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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 {

View File

@ -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;