mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-22 14:49:45 -04:00
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:
parent
239d7189fc
commit
3c55ec2020
3 changed files with 3 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue