]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: set flag SI_FL_CLEAN_ABRT when mux supports clean aborts
authorWilly Tarreau <w@1wt.eu>
Wed, 20 Dec 2017 15:31:43 +0000 (16:31 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 20 Dec 2017 15:56:32 +0000 (16:56 +0100)
By copying the info in the stream interface that the mux cleanly reports
aborts, we'll have the ability to check this flag wherever needed regardless
of the presence of a mux or not.

include/types/stream_interface.h
src/stream.c

index 95cf47a01ac81f292b5a5f1264d50f63d50b74ea..0c83759da2051bb19dded54dfb5c6cd2591ccb9c 100644 (file)
@@ -74,6 +74,7 @@ enum {
        SI_FL_SRC_ADDR   = 0x1000,  /* get the source ip/port with getsockname */
        SI_FL_WANT_PUT   = 0x2000,  /* an applet would like to put some data into the buffer */
        SI_FL_WANT_GET   = 0x4000,  /* an applet would like to get some data from the buffer */
+       SI_FL_CLEAN_ABRT = 0x8000,  /* SI_FL_ERR is used to report aborts, and not SHUTR */
 };
 
 /* A stream interface has 3 parts :
index 32da7c2e3527e14998cc2aa2a073b6033fe480e7..ba5dbffee6ac4f6c1a189fc5f377224229fb3401 100644 (file)
@@ -195,6 +195,9 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
        si_set_state(&s->si[0], SI_ST_EST);
        s->si[0].hcto = sess->fe->timeout.clientfin;
 
+       if (cs && cs->conn->mux && cs->conn->mux->flags & MX_FL_CLEAN_ABRT)
+               s->si[0].flags |= SI_FL_CLEAN_ABRT;
+
        /* attach the incoming connection to the stream interface now. */
        if (cs)
                si_attach_cs(&s->si[0], cs);