From: Willy Tarreau Date: Sun, 17 Aug 2008 16:16:38 +0000 (+0200) Subject: [BUG] process_cli/process_srv: don't call shutdown when already done X-Git-Tag: v1.3.16-rc1~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2500981dc1c55d577cb0e8ebffb7a13e07d6780b;p=thirdparty%2Fhaproxy.git [BUG] process_cli/process_srv: don't call shutdown when already done A few missing checks of BF_SHUTR and BF_SHUTW caused busy loops upon some error paths. --- diff --git a/src/proto_http.c b/src/proto_http.c index 91492b4e23..192b071545 100644 --- a/src/proto_http.c +++ b/src/proto_http.c @@ -3165,7 +3165,7 @@ int process_cli(struct session *t) goto update_state; } /* read timeout */ - else if (req->flags & BF_READ_TIMEOUT) { + else if ((req->flags & (BF_SHUTR|BF_READ_TIMEOUT)) == BF_READ_TIMEOUT) { buffer_shutr(req); if (!(rep->flags & BF_SHUTW)) { EV_FD_CLR(t->cli_fd, DIR_RD); @@ -3191,7 +3191,7 @@ int process_cli(struct session *t) goto update_state; } /* write timeout */ - else if (rep->flags & BF_WRITE_TIMEOUT) { + else if ((rep->flags & (BF_SHUTW|BF_WRITE_TIMEOUT)) == BF_WRITE_TIMEOUT) { buffer_shutw(rep); if (!(req->flags & BF_SHUTR)) { EV_FD_CLR(t->cli_fd, DIR_WR); @@ -3702,7 +3702,7 @@ int process_srv(struct session *t) goto update_state; } /* read timeout */ - else if (rep->flags & BF_READ_TIMEOUT) { + else if ((rep->flags & (BF_SHUTR|BF_READ_TIMEOUT)) == BF_READ_TIMEOUT) { buffer_shutr(rep); if (!(req->flags & BF_SHUTW)) { EV_FD_CLR(t->srv_fd, DIR_RD); @@ -3729,7 +3729,7 @@ int process_srv(struct session *t) goto update_state; } /* write timeout */ - else if (req->flags & BF_WRITE_TIMEOUT) { + else if ((req->flags & (BF_SHUTW|BF_WRITE_TIMEOUT)) == BF_WRITE_TIMEOUT) { buffer_shutw(req); if (!(rep->flags & BF_SHUTR)) { EV_FD_CLR(t->srv_fd, DIR_WR);