[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.
This commit is contained in:
Willy Tarreau 2008-08-17 18:16:38 +02:00
parent ffab5b4ab0
commit 2500981dc1

View File

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