MINOR: mux-h2/mux-fcgi: Fully rely on CS_EP_KILL_CONN
Instead of using a internal flag to kill the connection with the stream, we
now fully rely on CS_EP_KILL_CONN flag.
diff --git a/src/mux_fcgi.c b/src/mux_fcgi.c
index 6e99393..6133c7e 100644
--- a/src/mux_fcgi.c
+++ b/src/mux_fcgi.c
@@ -150,7 +150,6 @@
#define FCGI_SF_WANT_SHUTR 0x00001000 /* a stream couldn't shutr() (mux full/busy) */
#define FCGI_SF_WANT_SHUTW 0x00002000 /* a stream couldn't shutw() (mux full/busy) */
-#define FCGI_SF_KILL_CONN 0x00004000 /* kill the whole connection with this stream */
/* FCGI stream descriptor */
@@ -3724,7 +3723,7 @@
* for example because of a "tcp-request content reject" rule that is
* normally used to limit abuse.
*/
- if ((fstrm->flags & FCGI_SF_KILL_CONN) &&
+ if ((fstrm->endp->flags & CS_EP_KILL_CONN) &&
!(fconn->flags & (FCGI_CF_ABRTS_SENT|FCGI_CF_ABRTS_FAILED))) {
TRACE_STATE("stream wants to kill the connection", FCGI_EV_STRM_SHUT, fconn->conn, fstrm);
fconn->state = FCGI_CS_CLOSED;
@@ -3785,7 +3784,7 @@
* for example because of a "tcp-request content reject" rule that is
* normally used to limit abuse.
*/
- if ((fstrm->flags & FCGI_SF_KILL_CONN) &&
+ if ((fstrm->endp->flags & CS_EP_KILL_CONN) &&
!(fconn->flags & (FCGI_CF_ABRTS_SENT|FCGI_CF_ABRTS_FAILED))) {
TRACE_STATE("stream wants to kill the connection", FCGI_EV_STRM_SHUT, fconn->conn, fstrm);
fconn->state = FCGI_CS_CLOSED;
@@ -3860,12 +3859,8 @@
struct fcgi_strm *fstrm = __cs_mux(cs);
TRACE_POINT(FCGI_EV_STRM_SHUT, fstrm->fconn->conn, fstrm);
- if (cs->endp->flags & CS_EP_KILL_CONN)
- fstrm->flags |= FCGI_SF_KILL_CONN;
-
if (!mode)
return;
-
fcgi_do_shutr(fstrm);
}
@@ -3875,9 +3870,6 @@
struct fcgi_strm *fstrm = __cs_mux(cs);
TRACE_POINT(FCGI_EV_STRM_SHUT, fstrm->fconn->conn, fstrm);
- if (cs->endp->flags & CS_EP_KILL_CONN)
- fstrm->flags |= FCGI_SF_KILL_CONN;
-
fcgi_do_shutw(fstrm);
}
diff --git a/src/mux_h2.c b/src/mux_h2.c
index 37f86bc..4bd652e 100644
--- a/src/mux_h2.c
+++ b/src/mux_h2.c
@@ -202,7 +202,6 @@
#define H2_SF_WANT_SHUTR 0x00008000 // a stream couldn't shutr() (mux full/busy)
#define H2_SF_WANT_SHUTW 0x00010000 // a stream couldn't shutw() (mux full/busy)
-#define H2_SF_KILL_CONN 0x00020000 // kill the whole connection with this stream
#define H2_SF_EXT_CONNECT_SENT 0x00040000 // rfc 8441 an Extended CONNECT has been sent
#define H2_SF_EXT_CONNECT_RCVD 0x00080000 // rfc 8441 an Extended CONNECT has been received and parsed
@@ -4501,7 +4500,7 @@
* normally used to limit abuse. In this case we schedule a goaway to
* close the connection.
*/
- if ((h2s->flags & H2_SF_KILL_CONN) &&
+ if ((h2s->endp->flags & CS_EP_KILL_CONN) &&
!(h2c->flags & (H2_CF_GOAWAY_SENT|H2_CF_GOAWAY_FAILED))) {
TRACE_STATE("stream wants to kill the connection", H2_EV_STRM_SHUT, h2c->conn, h2s);
h2c_error(h2c, H2_ERR_ENHANCE_YOUR_CALM);
@@ -4579,7 +4578,7 @@
* normally used to limit abuse. In this case we schedule a goaway to
* close the connection.
*/
- if ((h2s->flags & H2_SF_KILL_CONN) &&
+ if ((h2s->endp->flags & CS_EP_KILL_CONN) &&
!(h2c->flags & (H2_CF_GOAWAY_SENT|H2_CF_GOAWAY_FAILED))) {
TRACE_STATE("stream wants to kill the connection", H2_EV_STRM_SHUT, h2c->conn, h2s);
h2c_error(h2c, H2_ERR_ENHANCE_YOUR_CALM);
@@ -4672,12 +4671,8 @@
struct h2s *h2s = __cs_mux(cs);
TRACE_ENTER(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
- if (cs->endp->flags & CS_EP_KILL_CONN)
- h2s->flags |= H2_SF_KILL_CONN;
-
if (mode)
h2_do_shutr(h2s);
-
TRACE_LEAVE(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
}
@@ -4687,9 +4682,6 @@
struct h2s *h2s = __cs_mux(cs);
TRACE_ENTER(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
- if (cs->endp->flags & CS_EP_KILL_CONN)
- h2s->flags |= H2_SF_KILL_CONN;
-
h2_do_shutw(h2s);
TRACE_LEAVE(H2_EV_STRM_SHUT, h2s->h2c->conn, h2s);
}