commit 247917be455490fb432d14a7cca37419333b7d3f from: Omar Polo date: Wed Sep 14 14:24:52 2022 UTC close fcgi socket when not marked as keepalive if the server hasn't specified the FCGI_KEEP_CONN bit in the request, close the socket when we're done. This seems to be what httpd(8) (most of the time) wants. commit - 4e2df59f1ce054617cd1ec17582b64f49596684c commit + 247917be455490fb432d14a7cca37419333b7d3f blob - 5876ccc00df7b8ed5658abe9d9b655d5d7260bb0 blob + 343235e2b8a8405d9203a5caaedf9eeb8ed2d1dd --- fcgi.c +++ fcgi.c @@ -177,6 +177,10 @@ end_request(struct client *clt, int status, int proto_ SPLAY_REMOVE(client_tree, &fcgi->fcg_clients, clt); proxy_client_free(clt); + + if (!fcgi->fcg_keep_conn) + fcgi->fcg_done = 1; + return (0); } @@ -511,8 +515,10 @@ void fcgi_write(struct bufferevent *bev, void *d) { struct fcgi *fcgi = d; + struct evbuffer *out = EVBUFFER_OUTPUT(bev); - (void)fcgi; + if (fcgi->fcg_done && EVBUFFER_LENGTH(out) == 0) + fcgi_error(bev, EVBUFFER_EOF, fcgi); } void blob - bb28819a1da4f114ba787a5fd935bc7b068ff1c3 blob + 515d41d950c37724dbb178c003a47d2a84d69946 --- galileo.h +++ galileo.h @@ -90,6 +90,7 @@ struct fcgi { int fcg_type; uint16_t fcg_rec_id; int fcg_keep_conn; + int fcg_done; struct galileo *fcg_env;