Fix FastCGI error handling

This commit is contained in:
2023-07-13 23:09:49 +02:00
parent 642286a838
commit 0f526d7b95
4 changed files with 13 additions and 5 deletions
+7 -3
View File
@@ -51,10 +51,9 @@ int fastcgi_handle_connection(client_ctx_t *ctx, fastcgi_cnx_t **cnx) {
}
void fastcgi_close(fastcgi_ctx_t *ctx) {
if (ctx->closed == 0) {
ctx->closed++;
ctx->closed++;
if (ctx->closed != 2)
return;
}
logger_set_prefix("[%*s]%s", ADDRSTRLEN, ctx->client->socket.s_addr, ctx->client->log_prefix);
@@ -70,3 +69,8 @@ void fastcgi_close(fastcgi_ctx_t *ctx) {
free(ctx);
errno = 0;
}
void fastcgi_close_error(fastcgi_ctx_t *ctx) {
logger_set_prefix("[%*s]%s", ADDRSTRLEN, ctx->client->socket.s_addr, ctx->client->log_prefix);
fastcgi_close_cnx(&ctx->cnx);
}