aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2022-11-29 23:06:39 +0000
committerOmar Polo <op@omarpolo.com>2022-11-29 23:06:39 +0000
commitdfa8b23f08ecd8b884c33986577983d380a4622a (patch)
tree8c76a996f613f64039e645d487fde1d929fe748e
parentc197ad99a36ea820b528cb9fd10ff80f96674bb8 (diff)
return after FCGI_END_REQUEST
backport 17493a486c9e6325c3aae74920ddb10958ae2771 this fixes a possible crash if `client_write' closes the connection, because client_close can end up freeing the fastcgi bufferevent while we're looping. We don't support fastcgi multiplexing, so once we get an END_REQUEST there's nothing more to do. Prodded into looking here after a bug report from Allen Sobot, thanks!
-rw-r--r--fcgi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fcgi.c b/fcgi.c
index 33df816..4c71d8f 100644
--- a/fcgi.c
+++ b/fcgi.c
@@ -290,7 +290,7 @@ fcgi_read(struct bufferevent *bev, void *d)
/* TODO: do something with the status? */
c->type = REQUEST_DONE;
client_write(c->bev, c);
- break;
+ return;
case FCGI_STDERR:
/* discard stderr (for now) */