MEDIUM: stream_interface: centralize the SI_FL_ERR management

It's better to have only stream_sock_update_conn() handle the conversion
of the CO_FL_ERROR flag to SI_FL_ERR than having it in each and every I/O
callback.
This commit is contained in:
Willy Tarreau 2012-07-23 19:19:51 +02:00 committed by Willy Tarreau
parent 239d7189fc
commit 3c55ec2020
3 changed files with 3 additions and 6 deletions

View File

@ -589,9 +589,7 @@ int tcp_connect_probe(struct connection *conn)
*/
conn->flags |= CO_FL_ERROR;
fdtab[fd].ev &= ~FD_POLL_STICKY;
EV_FD_REM(fd);
si->flags |= SI_FL_ERR;
retval = 1;
goto out_wakeup;
}

View File

@ -467,9 +467,7 @@ static int sock_raw_read(struct connection *conn)
*/
conn->flags |= CO_FL_ERROR;
fdtab[fd].ev &= ~FD_POLL_STICKY;
EV_FD_REM(fd);
si->flags |= SI_FL_ERR;
retval = 1;
goto out_wakeup;
}
@ -662,9 +660,7 @@ static int sock_raw_write(struct connection *conn)
*/
conn->flags |= CO_FL_ERROR;
fdtab[fd].ev &= ~FD_POLL_STICKY;
EV_FD_REM(fd);
si->flags |= SI_FL_ERR;
return 1;
}

View File

@ -498,6 +498,9 @@ void stream_sock_update_conn(struct connection *conn)
__FUNCTION__,
si, si->state, si->ib->flags, si->ob->flags);
if (conn->flags & CO_FL_ERROR)
si->flags |= SI_FL_ERR;
/* process consumer side, only once if possible */
if (fdtab[fd].ev & (FD_POLL_OUT | FD_POLL_ERR)) {
if (si->ob->flags & BF_OUT_EMPTY) {