mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MINOR: connstream: have a new flag CS_FL_KILL_CONN to kill a connection
This is the equivalent of SI_FL_KILL_CONN but for the connstreams. It will be set by the stream-interface during the various shutdown operations.
This commit is contained in:
parent
0f9cd7b196
commit
51d0a7e54c
@ -88,6 +88,7 @@ enum {
|
|||||||
CS_FL_EOS = 0x00001000, /* End of stream delivered to data layer */
|
CS_FL_EOS = 0x00001000, /* End of stream delivered to data layer */
|
||||||
CS_FL_REOS = 0x00002000, /* End of stream received (buffer not empty) */
|
CS_FL_REOS = 0x00002000, /* End of stream received (buffer not empty) */
|
||||||
CS_FL_WAIT_FOR_HS = 0x00010000, /* This stream is waiting for handhskae */
|
CS_FL_WAIT_FOR_HS = 0x00010000, /* This stream is waiting for handhskae */
|
||||||
|
CS_FL_KILL_CONN = 0x00020000, /* must kill the connection when the CS closes */
|
||||||
|
|
||||||
/* following flags are supposed to be set by the mux and read/unset by
|
/* following flags are supposed to be set by the mux and read/unset by
|
||||||
* the stream-interface :
|
* the stream-interface :
|
||||||
|
@ -904,6 +904,9 @@ static void stream_int_shutr_conn(struct stream_interface *si)
|
|||||||
if (si->state != SI_ST_EST && si->state != SI_ST_CON)
|
if (si->state != SI_ST_EST && si->state != SI_ST_CON)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (si->flags & SI_FL_KILL_CONN)
|
||||||
|
cs->flags |= CS_FL_KILL_CONN;
|
||||||
|
|
||||||
if (si_oc(si)->flags & CF_SHUTW) {
|
if (si_oc(si)->flags & CF_SHUTW) {
|
||||||
cs_close(cs);
|
cs_close(cs);
|
||||||
si->state = SI_ST_DIS;
|
si->state = SI_ST_DIS;
|
||||||
@ -950,6 +953,9 @@ static void stream_int_shutw_conn(struct stream_interface *si)
|
|||||||
* However, if SI_FL_NOLINGER is explicitly set, we know there is
|
* However, if SI_FL_NOLINGER is explicitly set, we know there is
|
||||||
* no risk so we close both sides immediately.
|
* no risk so we close both sides immediately.
|
||||||
*/
|
*/
|
||||||
|
if (si->flags & SI_FL_KILL_CONN)
|
||||||
|
cs->flags |= CS_FL_KILL_CONN;
|
||||||
|
|
||||||
if (si->flags & SI_FL_ERR) {
|
if (si->flags & SI_FL_ERR) {
|
||||||
/* quick close, the socket is alredy shut anyway */
|
/* quick close, the socket is alredy shut anyway */
|
||||||
}
|
}
|
||||||
@ -984,6 +990,8 @@ static void stream_int_shutw_conn(struct stream_interface *si)
|
|||||||
/* we may have to close a pending connection, and mark the
|
/* we may have to close a pending connection, and mark the
|
||||||
* response buffer as shutr
|
* response buffer as shutr
|
||||||
*/
|
*/
|
||||||
|
if (si->flags & SI_FL_KILL_CONN)
|
||||||
|
cs->flags |= CS_FL_KILL_CONN;
|
||||||
cs_close(cs);
|
cs_close(cs);
|
||||||
/* fall through */
|
/* fall through */
|
||||||
case SI_ST_CER:
|
case SI_ST_CER:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user