]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stream_interface: centralize the SI_FL_ERR management
authorWilly Tarreau <wtarreau@exceliance.fr>
Mon, 23 Jul 2012 17:19:51 +0000 (19:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 2 Sep 2012 19:53:09 +0000 (21:53 +0200)
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.

src/proto_tcp.c
src/sock_raw.c
src/stream_interface.c

index cebc477107d6894cb3f54adac20478d8b10dcc51..c785384ec6cd30b1b71c9ffdfa041666ed662ed4 100644 (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;
 }
index cdb0e271406f7eca10df4d34144eae75a552903d..8136d601ca346dfefd71df8aa27d7a07f2916a0c 100644 (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;
 }
 
index 9d6f9616c47f56daa8a08e9d0cf6ce8f53ee7c82..1a6db199ac0c8e389048559ccba94e1f480bf1ec 100644 (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) {