mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
CLEANUP: stconn: tree-wide rename stream connector flags CS_FL_* to SC_FL_*
This follows the natural naming. There are roughly 100 changes, all totally trivial.
This commit is contained in:
parent
7cb9e6c6ba
commit
cb04166525
@ -224,11 +224,11 @@ void show_cs_flags(unsigned int f)
|
|||||||
printf("0\n");
|
printf("0\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SHOW_FLAG(f, CS_FL_INDEP_STR);
|
SHOW_FLAG(f, SC_FL_INDEP_STR);
|
||||||
SHOW_FLAG(f, CS_FL_DONT_WAKE);
|
SHOW_FLAG(f, SC_FL_DONT_WAKE);
|
||||||
SHOW_FLAG(f, CS_FL_NOLINGER);
|
SHOW_FLAG(f, SC_FL_NOLINGER);
|
||||||
SHOW_FLAG(f, CS_FL_NOHALF);
|
SHOW_FLAG(f, SC_FL_NOHALF);
|
||||||
SHOW_FLAG(f, CS_FL_ISBACK);
|
SHOW_FLAG(f, SC_FL_ISBACK);
|
||||||
|
|
||||||
if (f) {
|
if (f) {
|
||||||
printf("EXTRA(0x%08x)", f);
|
printf("EXTRA(0x%08x)", f);
|
||||||
|
@ -85,17 +85,17 @@ enum se_flags {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* stconn flags */
|
/* stconn flags */
|
||||||
enum {
|
enum sc_flags {
|
||||||
CS_FL_NONE = 0x00000000, /* Just for initialization purposes */
|
SC_FL_NONE = 0x00000000, /* Just for initialization purposes */
|
||||||
CS_FL_ISBACK = 0x00000001, /* Set for CS on back-side */
|
SC_FL_ISBACK = 0x00000001, /* Set for SC on back-side */
|
||||||
|
|
||||||
/* not used: 0x00000002 */
|
/* not used: 0x00000002 */
|
||||||
/* not used: 0x00000004 */
|
/* not used: 0x00000004 */
|
||||||
|
|
||||||
CS_FL_NOLINGER = 0x00000008, /* may close without lingering. One-shot. */
|
SC_FL_NOLINGER = 0x00000008, /* may close without lingering. One-shot. */
|
||||||
CS_FL_NOHALF = 0x00000010, /* no half close, close both sides at once */
|
SC_FL_NOHALF = 0x00000010, /* no half close, close both sides at once */
|
||||||
CS_FL_DONT_WAKE = 0x00000020, /* resync in progress, don't wake up */
|
SC_FL_DONT_WAKE = 0x00000020, /* resync in progress, don't wake up */
|
||||||
CS_FL_INDEP_STR = 0x00000040, /* independent streams = don't update rex on write */
|
SC_FL_INDEP_STR = 0x00000040, /* independent streams = don't update rex on write */
|
||||||
};
|
};
|
||||||
|
|
||||||
/* A conn stream must have its own errors independently of the buffer's, so that
|
/* A conn stream must have its own errors independently of the buffer's, so that
|
||||||
@ -189,7 +189,7 @@ struct stconn {
|
|||||||
enum cs_state state; /* CS_ST* */
|
enum cs_state state; /* CS_ST* */
|
||||||
/* 2 bytes hole here */
|
/* 2 bytes hole here */
|
||||||
|
|
||||||
unsigned int flags; /* CS_FL_* */
|
unsigned int flags; /* SC_FL_* */
|
||||||
unsigned int hcto; /* half-closed timeout (0 = unset) */
|
unsigned int hcto; /* half-closed timeout (0 = unset) */
|
||||||
struct wait_event wait_event; /* We're in a wait list */
|
struct wait_event wait_event; /* We're in a wait list */
|
||||||
struct sedesc *sedesc; /* points to the stream endpoint descriptor */
|
struct sedesc *sedesc; /* points to the stream endpoint descriptor */
|
||||||
|
@ -46,7 +46,7 @@ static inline struct channel *cs_ic(struct stconn *cs)
|
|||||||
{
|
{
|
||||||
struct stream *strm = __cs_strm(cs);
|
struct stream *strm = __cs_strm(cs);
|
||||||
|
|
||||||
return ((cs->flags & CS_FL_ISBACK) ? &(strm->res) : &(strm->req));
|
return ((cs->flags & SC_FL_ISBACK) ? &(strm->res) : &(strm->req));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the channel which feeds data to this stream connector (output channel) */
|
/* returns the channel which feeds data to this stream connector (output channel) */
|
||||||
@ -54,7 +54,7 @@ static inline struct channel *cs_oc(struct stconn *cs)
|
|||||||
{
|
{
|
||||||
struct stream *strm = __cs_strm(cs);
|
struct stream *strm = __cs_strm(cs);
|
||||||
|
|
||||||
return ((cs->flags & CS_FL_ISBACK) ? &(strm->req) : &(strm->res));
|
return ((cs->flags & SC_FL_ISBACK) ? &(strm->req) : &(strm->res));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns the buffer which receives data from this stream connector (input channel's buffer) */
|
/* returns the buffer which receives data from this stream connector (input channel's buffer) */
|
||||||
@ -81,11 +81,11 @@ static inline struct stconn *cs_opposite(struct stconn *cs)
|
|||||||
{
|
{
|
||||||
struct stream *strm = __cs_strm(cs);
|
struct stream *strm = __cs_strm(cs);
|
||||||
|
|
||||||
return ((cs->flags & CS_FL_ISBACK) ? strm->scf : strm->scb);
|
return ((cs->flags & SC_FL_ISBACK) ? strm->scf : strm->scb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* to be called only when in CS_ST_DIS with CS_FL_ERR */
|
/* to be called only when in CS_ST_DIS with SC_FL_ERR */
|
||||||
static inline void cs_report_error(struct stconn *cs)
|
static inline void cs_report_error(struct stconn *cs)
|
||||||
{
|
{
|
||||||
if (!__cs_strm(cs)->conn_err_type)
|
if (!__cs_strm(cs)->conn_err_type)
|
||||||
@ -173,7 +173,7 @@ static inline const struct sockaddr_storage *cs_src(struct stconn *cs)
|
|||||||
{
|
{
|
||||||
if (cs->src)
|
if (cs->src)
|
||||||
return cs->src;
|
return cs->src;
|
||||||
if (!(cs->flags & CS_FL_ISBACK))
|
if (!(cs->flags & SC_FL_ISBACK))
|
||||||
return sess_src(strm_sess(__cs_strm(cs)));
|
return sess_src(strm_sess(__cs_strm(cs)));
|
||||||
else {
|
else {
|
||||||
struct connection *conn = cs_conn(cs);
|
struct connection *conn = cs_conn(cs);
|
||||||
@ -193,7 +193,7 @@ static inline const struct sockaddr_storage *cs_dst(struct stconn *cs)
|
|||||||
{
|
{
|
||||||
if (cs->dst)
|
if (cs->dst)
|
||||||
return cs->dst;
|
return cs->dst;
|
||||||
if (!(cs->flags & CS_FL_ISBACK))
|
if (!(cs->flags & SC_FL_ISBACK))
|
||||||
return sess_dst(strm_sess(__cs_strm(cs)));
|
return sess_dst(strm_sess(__cs_strm(cs)));
|
||||||
else {
|
else {
|
||||||
struct connection *conn = cs_conn(cs);
|
struct connection *conn = cs_conn(cs);
|
||||||
@ -217,7 +217,7 @@ static inline int cs_get_src(struct stconn *cs)
|
|||||||
if (cs->src)
|
if (cs->src)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!(cs->flags & CS_FL_ISBACK))
|
if (!(cs->flags & SC_FL_ISBACK))
|
||||||
src = sess_src(strm_sess(__cs_strm(cs)));
|
src = sess_src(strm_sess(__cs_strm(cs)));
|
||||||
else {
|
else {
|
||||||
struct connection *conn = cs_conn(cs);
|
struct connection *conn = cs_conn(cs);
|
||||||
@ -247,7 +247,7 @@ static inline int cs_get_dst(struct stconn *cs)
|
|||||||
if (cs->dst)
|
if (cs->dst)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (!(cs->flags & CS_FL_ISBACK))
|
if (!(cs->flags & SC_FL_ISBACK))
|
||||||
dst = sess_dst(strm_sess(__cs_strm(cs)));
|
dst = sess_dst(strm_sess(__cs_strm(cs)));
|
||||||
else {
|
else {
|
||||||
struct connection *conn = cs_conn(cs);
|
struct connection *conn = cs_conn(cs);
|
||||||
|
@ -114,7 +114,7 @@ void appctx_free_on_early_error(struct appctx *appctx)
|
|||||||
/* If a frontend appctx is attached to a stream connector, release the stream
|
/* If a frontend appctx is attached to a stream connector, release the stream
|
||||||
* instead of the appctx.
|
* instead of the appctx.
|
||||||
*/
|
*/
|
||||||
if (!se_fl_test(appctx->sedesc, SE_FL_ORPHAN) && !(appctx_cs(appctx)->flags & CS_FL_ISBACK)) {
|
if (!se_fl_test(appctx->sedesc, SE_FL_ORPHAN) && !(appctx_cs(appctx)->flags & SC_FL_ISBACK)) {
|
||||||
stream_free(appctx_strm(appctx));
|
stream_free(appctx_strm(appctx));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1722,7 +1722,7 @@ static int connect_server(struct stream *s)
|
|||||||
|
|
||||||
/* disable lingering */
|
/* disable lingering */
|
||||||
if (s->be->options & PR_O_TCP_NOLING)
|
if (s->be->options & PR_O_TCP_NOLING)
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
|
|
||||||
if (s->flags & SF_SRV_REUSED) {
|
if (s->flags & SF_SRV_REUSED) {
|
||||||
_HA_ATOMIC_INC(&s->be->be_counters.reuse);
|
_HA_ATOMIC_INC(&s->be->be_counters.reuse);
|
||||||
@ -2250,7 +2250,7 @@ void back_handle_st_con(struct stream *s)
|
|||||||
if ((rep->flags & CF_SHUTW) ||
|
if ((rep->flags & CF_SHUTW) ||
|
||||||
((req->flags & CF_SHUTW_NOW) &&
|
((req->flags & CF_SHUTW_NOW) &&
|
||||||
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
|
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
|
||||||
cs->flags |= CS_FL_NOLINGER;
|
cs->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutw(cs);
|
cs_shutw(cs);
|
||||||
s->conn_err_type |= STRM_ET_CONN_ABRT;
|
s->conn_err_type |= STRM_ET_CONN_ABRT;
|
||||||
if (s->srv_error)
|
if (s->srv_error)
|
||||||
@ -2479,7 +2479,7 @@ void back_handle_st_rdy(struct stream *s)
|
|||||||
((req->flags & CF_SHUTW_NOW) &&
|
((req->flags & CF_SHUTW_NOW) &&
|
||||||
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
|
(channel_is_empty(req) || (s->be->options & PR_O_ABRT_CLOSE)))) {
|
||||||
/* give up */
|
/* give up */
|
||||||
cs->flags |= CS_FL_NOLINGER;
|
cs->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutw(cs);
|
cs_shutw(cs);
|
||||||
s->conn_err_type |= STRM_ET_CONN_ABRT;
|
s->conn_err_type |= STRM_ET_CONN_ABRT;
|
||||||
if (s->srv_error)
|
if (s->srv_error)
|
||||||
|
@ -1126,7 +1126,7 @@ struct task *process_chk_conn(struct task *t, void *context, unsigned int state)
|
|||||||
|
|
||||||
check->current_step = NULL;
|
check->current_step = NULL;
|
||||||
|
|
||||||
check->cs = cs_new_from_check(check, CS_FL_NONE);
|
check->cs = cs_new_from_check(check, SC_FL_NONE);
|
||||||
if (!check->cs) {
|
if (!check->cs) {
|
||||||
set_server_check_status(check, HCHK_STATUS_SOCKERR, NULL);
|
set_server_check_status(check, HCHK_STATUS_SOCKERR, NULL);
|
||||||
goto end;
|
goto end;
|
||||||
|
@ -2704,7 +2704,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
|
|
||||||
pcli_write_prompt(s);
|
pcli_write_prompt(s);
|
||||||
|
|
||||||
s->scb->flags |= CS_FL_NOLINGER | CS_FL_NOHALF;
|
s->scb->flags |= SC_FL_NOLINGER | SC_FL_NOHALF;
|
||||||
cs_shutr(s->scb);
|
cs_shutr(s->scb);
|
||||||
cs_shutw(s->scb);
|
cs_shutw(s->scb);
|
||||||
|
|
||||||
@ -2788,7 +2788,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
sockaddr_free(&s->scb->dst);
|
sockaddr_free(&s->scb->dst);
|
||||||
|
|
||||||
cs_set_state(s->scb, CS_ST_INI);
|
cs_set_state(s->scb, CS_ST_INI);
|
||||||
s->scb->flags &= CS_FL_ISBACK | CS_FL_DONT_WAKE; /* we're in the context of process_stream */
|
s->scb->flags &= SC_FL_ISBACK | SC_FL_DONT_WAKE; /* we're in the context of process_stream */
|
||||||
s->req.flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WROTE_DATA);
|
s->req.flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WROTE_DATA);
|
||||||
s->res.flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT|CF_WROTE_DATA|CF_READ_NULL);
|
s->res.flags &= ~(CF_SHUTR|CF_SHUTR_NOW|CF_READ_ATTACHED|CF_READ_ERROR|CF_READ_NOEXP|CF_STREAMER|CF_STREAMER_FAST|CF_WRITE_PARTIAL|CF_NEVER_WAIT|CF_WROTE_DATA|CF_READ_NULL);
|
||||||
s->flags &= ~(SF_DIRECT|SF_ASSIGNED|SF_BE_ASSIGNED|SF_FORCE_PRST|SF_IGNORE_PRST);
|
s->flags &= ~(SF_DIRECT|SF_ASSIGNED|SF_BE_ASSIGNED|SF_FORCE_PRST|SF_IGNORE_PRST);
|
||||||
|
@ -126,7 +126,7 @@ static struct stconn *cs_new(struct sedesc *sedesc)
|
|||||||
goto alloc_error;
|
goto alloc_error;
|
||||||
|
|
||||||
cs->obj_type = OBJ_TYPE_CS;
|
cs->obj_type = OBJ_TYPE_CS;
|
||||||
cs->flags = CS_FL_NONE;
|
cs->flags = SC_FL_NONE;
|
||||||
cs->state = CS_ST_INI;
|
cs->state = CS_ST_INI;
|
||||||
cs->hcto = TICK_ETERNITY;
|
cs->hcto = TICK_ETERNITY;
|
||||||
cs->app = NULL;
|
cs->app = NULL;
|
||||||
@ -391,7 +391,7 @@ static void cs_detach_endp(struct stconn **csp)
|
|||||||
/* FIXME: Rest CS for now but must be reviewed. CS flags are only
|
/* FIXME: Rest CS for now but must be reviewed. CS flags are only
|
||||||
* connection related for now but this will evolved
|
* connection related for now but this will evolved
|
||||||
*/
|
*/
|
||||||
cs->flags &= CS_FL_ISBACK;
|
cs->flags &= SC_FL_ISBACK;
|
||||||
if (cs_strm(cs))
|
if (cs_strm(cs))
|
||||||
cs->ops = &sc_app_embedded_ops;
|
cs->ops = &sc_app_embedded_ops;
|
||||||
cs->data_cb = NULL;
|
cs->data_cb = NULL;
|
||||||
@ -501,7 +501,7 @@ struct appctx *cs_applet_create(struct stconn *cs, struct applet *app)
|
|||||||
* This function performs a shutdown-read on a detached stream connector in a
|
* This function performs a shutdown-read on a detached stream connector in a
|
||||||
* connected or init state (it does nothing for other states). It either shuts
|
* connected or init state (it does nothing for other states). It either shuts
|
||||||
* the read side or marks itself as closed. The buffer flags are updated to
|
* the read side or marks itself as closed. The buffer flags are updated to
|
||||||
* reflect the new state. If the stream connector has CS_FL_NOHALF, we also
|
* reflect the new state. If the stream connector has SC_FL_NOHALF, we also
|
||||||
* forward the close to the write side. The owner task is woken up if it exists.
|
* forward the close to the write side. The owner task is woken up if it exists.
|
||||||
*/
|
*/
|
||||||
static void sc_app_shutr(struct stconn *cs)
|
static void sc_app_shutr(struct stconn *cs)
|
||||||
@ -521,13 +521,13 @@ static void sc_app_shutr(struct stconn *cs)
|
|||||||
cs->state = CS_ST_DIS;
|
cs->state = CS_ST_DIS;
|
||||||
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
|
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
|
||||||
}
|
}
|
||||||
else if (cs->flags & CS_FL_NOHALF) {
|
else if (cs->flags & SC_FL_NOHALF) {
|
||||||
/* we want to immediately forward this close to the write side */
|
/* we want to immediately forward this close to the write side */
|
||||||
return sc_app_shutw(cs);
|
return sc_app_shutw(cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* note that if the task exists, it must unregister itself once it runs */
|
/* note that if the task exists, it must unregister itself once it runs */
|
||||||
if (!(cs->flags & CS_FL_DONT_WAKE))
|
if (!(cs->flags & SC_FL_DONT_WAKE))
|
||||||
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,10 +561,10 @@ static void sc_app_shutw(struct stconn *cs)
|
|||||||
/* we have to shut before closing, otherwise some short messages
|
/* we have to shut before closing, otherwise some short messages
|
||||||
* may never leave the system, especially when there are remaining
|
* may never leave the system, especially when there are remaining
|
||||||
* unread data in the socket input buffer, or when nolinger is set.
|
* unread data in the socket input buffer, or when nolinger is set.
|
||||||
* However, if CS_FL_NOLINGER is explicitly set, we know there is
|
* However, if SC_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 (!sc_ep_test(cs, SE_FL_ERROR) && !(cs->flags & CS_FL_NOLINGER) &&
|
if (!sc_ep_test(cs, SE_FL_ERROR) && !(cs->flags & SC_FL_NOLINGER) &&
|
||||||
!(ic->flags & (CF_SHUTR|CF_DONT_READ)))
|
!(ic->flags & (CF_SHUTR|CF_DONT_READ)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -577,7 +577,7 @@ static void sc_app_shutw(struct stconn *cs)
|
|||||||
cs->state = CS_ST_DIS;
|
cs->state = CS_ST_DIS;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
cs->flags &= ~CS_FL_NOLINGER;
|
cs->flags &= ~SC_FL_NOLINGER;
|
||||||
cs_rx_shut_blk(cs);
|
cs_rx_shut_blk(cs);
|
||||||
ic->flags |= CF_SHUTR;
|
ic->flags |= CF_SHUTR;
|
||||||
ic->rex = TICK_ETERNITY;
|
ic->rex = TICK_ETERNITY;
|
||||||
@ -585,7 +585,7 @@ static void sc_app_shutw(struct stconn *cs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* note that if the task exists, it must unregister itself once it runs */
|
/* note that if the task exists, it must unregister itself once it runs */
|
||||||
if (!(cs->flags & CS_FL_DONT_WAKE))
|
if (!(cs->flags & SC_FL_DONT_WAKE))
|
||||||
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,7 +604,7 @@ static void sc_app_chk_rcv(struct stconn *cs)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* (re)start reading */
|
/* (re)start reading */
|
||||||
if (!(cs->flags & CS_FL_DONT_WAKE))
|
if (!(cs->flags & SC_FL_DONT_WAKE))
|
||||||
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -632,7 +632,7 @@ static void sc_app_chk_snd(struct stconn *cs)
|
|||||||
if (!tick_isset(oc->wex))
|
if (!tick_isset(oc->wex))
|
||||||
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
||||||
|
|
||||||
if (!(cs->flags & CS_FL_DONT_WAKE))
|
if (!(cs->flags & SC_FL_DONT_WAKE))
|
||||||
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -641,7 +641,7 @@ static void sc_app_chk_snd(struct stconn *cs)
|
|||||||
* a connection in a connected or init state (it does nothing for other
|
* a connection in a connected or init state (it does nothing for other
|
||||||
* states). It either shuts the read side or marks itself as closed. The buffer
|
* states). It either shuts the read side or marks itself as closed. The buffer
|
||||||
* flags are updated to reflect the new state. If the stream connector has
|
* flags are updated to reflect the new state. If the stream connector has
|
||||||
* CS_FL_NOHALF, we also forward the close to the write side. If a control
|
* SC_FL_NOHALF, we also forward the close to the write side. If a control
|
||||||
* layer is defined, then it is supposed to be a socket layer and file
|
* layer is defined, then it is supposed to be a socket layer and file
|
||||||
* descriptors are then shutdown or closed accordingly. The function
|
* descriptors are then shutdown or closed accordingly. The function
|
||||||
* automatically disables polling if needed.
|
* automatically disables polling if needed.
|
||||||
@ -666,7 +666,7 @@ static void sc_app_shutr_conn(struct stconn *cs)
|
|||||||
cs->state = CS_ST_DIS;
|
cs->state = CS_ST_DIS;
|
||||||
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
|
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
|
||||||
}
|
}
|
||||||
else if (cs->flags & CS_FL_NOHALF) {
|
else if (cs->flags & SC_FL_NOHALF) {
|
||||||
/* we want to immediately forward this close to the write side */
|
/* we want to immediately forward this close to the write side */
|
||||||
return sc_app_shutw_conn(cs);
|
return sc_app_shutw_conn(cs);
|
||||||
}
|
}
|
||||||
@ -705,14 +705,14 @@ static void sc_app_shutw_conn(struct stconn *cs)
|
|||||||
/* we have to shut before closing, otherwise some short messages
|
/* we have to shut before closing, otherwise some short messages
|
||||||
* may never leave the system, especially when there are remaining
|
* may never leave the system, especially when there are remaining
|
||||||
* unread data in the socket input buffer, or when nolinger is set.
|
* unread data in the socket input buffer, or when nolinger is set.
|
||||||
* However, if CS_FL_NOLINGER is explicitly set, we know there is
|
* However, if SC_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 (sc_ep_test(cs, SE_FL_ERROR)) {
|
if (sc_ep_test(cs, SE_FL_ERROR)) {
|
||||||
/* quick close, the socket is already shut anyway */
|
/* quick close, the socket is already shut anyway */
|
||||||
}
|
}
|
||||||
else if (cs->flags & CS_FL_NOLINGER) {
|
else if (cs->flags & SC_FL_NOLINGER) {
|
||||||
/* unclean data-layer shutdown, typically an aborted request
|
/* unclean data-layer shutdown, typically an aborted request
|
||||||
* or a forwarded shutdown from a client to a server due to
|
* or a forwarded shutdown from a client to a server due to
|
||||||
* option abortonclose. No need for the TLS layer to try to
|
* option abortonclose. No need for the TLS layer to try to
|
||||||
@ -746,7 +746,7 @@ static void sc_app_shutw_conn(struct stconn *cs)
|
|||||||
cs->state = CS_ST_DIS;
|
cs->state = CS_ST_DIS;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
cs->flags &= ~CS_FL_NOLINGER;
|
cs->flags &= ~SC_FL_NOLINGER;
|
||||||
cs_rx_shut_blk(cs);
|
cs_rx_shut_blk(cs);
|
||||||
ic->flags |= CF_SHUTR;
|
ic->flags |= CF_SHUTR;
|
||||||
ic->rex = TICK_ETERNITY;
|
ic->rex = TICK_ETERNITY;
|
||||||
@ -839,7 +839,7 @@ static void sc_app_chk_snd_conn(struct stconn *cs)
|
|||||||
!channel_is_empty(oc))
|
!channel_is_empty(oc))
|
||||||
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
||||||
|
|
||||||
if (tick_isset(ic->rex) && !(cs->flags & CS_FL_INDEP_STR)) {
|
if (tick_isset(ic->rex) && !(cs->flags & SC_FL_INDEP_STR)) {
|
||||||
/* Note: to prevent the client from expiring read timeouts
|
/* Note: to prevent the client from expiring read timeouts
|
||||||
* during writes, we refresh it. We only do this if the
|
* during writes, we refresh it. We only do this if the
|
||||||
* interface is not configured for "independent streams",
|
* interface is not configured for "independent streams",
|
||||||
@ -860,7 +860,7 @@ static void sc_app_chk_snd_conn(struct stconn *cs)
|
|||||||
((channel_is_empty(oc) && !oc->to_forward) ||
|
((channel_is_empty(oc) && !oc->to_forward) ||
|
||||||
!cs_state_in(cs->state, CS_SB_EST))))) {
|
!cs_state_in(cs->state, CS_SB_EST))))) {
|
||||||
out_wakeup:
|
out_wakeup:
|
||||||
if (!(cs->flags & CS_FL_DONT_WAKE))
|
if (!(cs->flags & SC_FL_DONT_WAKE))
|
||||||
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
task_wakeup(cs_strm_task(cs), TASK_WOKEN_IO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -869,7 +869,7 @@ static void sc_app_chk_snd_conn(struct stconn *cs)
|
|||||||
* This function performs a shutdown-read on a stream connector attached to an
|
* This function performs a shutdown-read on a stream connector attached to an
|
||||||
* applet in a connected or init state (it does nothing for other states). It
|
* applet in a connected or init state (it does nothing for other states). It
|
||||||
* either shuts the read side or marks itself as closed. The buffer flags are
|
* either shuts the read side or marks itself as closed. The buffer flags are
|
||||||
* updated to reflect the new state. If the stream connector has CS_FL_NOHALF,
|
* updated to reflect the new state. If the stream connector has SC_FL_NOHALF,
|
||||||
* we also forward the close to the write side. The owner task is woken up if
|
* we also forward the close to the write side. The owner task is woken up if
|
||||||
* it exists.
|
* it exists.
|
||||||
*/
|
*/
|
||||||
@ -895,7 +895,7 @@ static void sc_app_shutr_applet(struct stconn *cs)
|
|||||||
cs->state = CS_ST_DIS;
|
cs->state = CS_ST_DIS;
|
||||||
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
|
__cs_strm(cs)->conn_exp = TICK_ETERNITY;
|
||||||
}
|
}
|
||||||
else if (cs->flags & CS_FL_NOHALF) {
|
else if (cs->flags & SC_FL_NOHALF) {
|
||||||
/* we want to immediately forward this close to the write side */
|
/* we want to immediately forward this close to the write side */
|
||||||
return sc_app_shutw_applet(cs);
|
return sc_app_shutw_applet(cs);
|
||||||
}
|
}
|
||||||
@ -936,10 +936,10 @@ static void sc_app_shutw_applet(struct stconn *cs)
|
|||||||
/* we have to shut before closing, otherwise some short messages
|
/* we have to shut before closing, otherwise some short messages
|
||||||
* may never leave the system, especially when there are remaining
|
* may never leave the system, especially when there are remaining
|
||||||
* unread data in the socket input buffer, or when nolinger is set.
|
* unread data in the socket input buffer, or when nolinger is set.
|
||||||
* However, if CS_FL_NOLINGER is explicitly set, we know there is
|
* However, if SC_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 (!sc_ep_test(cs, SE_FL_ERROR) && !(cs->flags & CS_FL_NOLINGER) &&
|
if (!sc_ep_test(cs, SE_FL_ERROR) && !(cs->flags & SC_FL_NOLINGER) &&
|
||||||
!(ic->flags & (CF_SHUTR|CF_DONT_READ)))
|
!(ic->flags & (CF_SHUTR|CF_DONT_READ)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -953,7 +953,7 @@ static void sc_app_shutw_applet(struct stconn *cs)
|
|||||||
cs->state = CS_ST_DIS;
|
cs->state = CS_ST_DIS;
|
||||||
/* fall through */
|
/* fall through */
|
||||||
default:
|
default:
|
||||||
cs->flags &= ~CS_FL_NOLINGER;
|
cs->flags &= ~SC_FL_NOLINGER;
|
||||||
cs_rx_shut_blk(cs);
|
cs_rx_shut_blk(cs);
|
||||||
ic->flags |= CF_SHUTR;
|
ic->flags |= CF_SHUTR;
|
||||||
ic->rex = TICK_ETERNITY;
|
ic->rex = TICK_ETERNITY;
|
||||||
@ -1087,7 +1087,7 @@ void cs_update_tx(struct stconn *cs)
|
|||||||
sc_ep_clr(cs, SE_FL_WAIT_DATA);
|
sc_ep_clr(cs, SE_FL_WAIT_DATA);
|
||||||
if (!tick_isset(oc->wex)) {
|
if (!tick_isset(oc->wex)) {
|
||||||
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
||||||
if (tick_isset(ic->rex) && !(cs->flags & CS_FL_INDEP_STR)) {
|
if (tick_isset(ic->rex) && !(cs->flags & SC_FL_INDEP_STR)) {
|
||||||
/* Note: depending on the protocol, we don't know if we're waiting
|
/* Note: depending on the protocol, we don't know if we're waiting
|
||||||
* for incoming data or not. So in order to prevent the socket from
|
* for incoming data or not. So in order to prevent the socket from
|
||||||
* expiring read timeouts during writes, we refresh the read timeout,
|
* expiring read timeouts during writes, we refresh the read timeout,
|
||||||
@ -1141,7 +1141,7 @@ static void cs_notify(struct stconn *cs)
|
|||||||
if (tick_isset(oc->wex))
|
if (tick_isset(oc->wex))
|
||||||
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
oc->wex = tick_add_ifset(now_ms, oc->wto);
|
||||||
|
|
||||||
if (!(cs->flags & CS_FL_INDEP_STR))
|
if (!(cs->flags & SC_FL_INDEP_STR))
|
||||||
if (tick_isset(ic->rex))
|
if (tick_isset(ic->rex))
|
||||||
ic->rex = tick_add_ifset(now_ms, ic->rto);
|
ic->rex = tick_add_ifset(now_ms, ic->rto);
|
||||||
}
|
}
|
||||||
@ -1235,7 +1235,7 @@ static void cs_notify(struct stconn *cs)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* This function propagates a null read received on a socket-based connection.
|
* This function propagates a null read received on a socket-based connection.
|
||||||
* It updates the stream connector. If the stream connector has CS_FL_NOHALF,
|
* It updates the stream connector. If the stream connector has SC_FL_NOHALF,
|
||||||
* the close is also forwarded to the write side as an abort.
|
* the close is also forwarded to the write side as an abort.
|
||||||
*/
|
*/
|
||||||
static void cs_conn_read0(struct stconn *cs)
|
static void cs_conn_read0(struct stconn *cs)
|
||||||
@ -1257,7 +1257,7 @@ static void cs_conn_read0(struct stconn *cs)
|
|||||||
if (oc->flags & CF_SHUTW)
|
if (oc->flags & CF_SHUTW)
|
||||||
goto do_close;
|
goto do_close;
|
||||||
|
|
||||||
if (cs->flags & CS_FL_NOHALF) {
|
if (cs->flags & SC_FL_NOHALF) {
|
||||||
/* we want to immediately forward this close to the write side */
|
/* we want to immediately forward this close to the write side */
|
||||||
/* force flag on ssl to keep stream in cache */
|
/* force flag on ssl to keep stream in cache */
|
||||||
cs_conn_shutw(cs, CO_SHW_SILENT);
|
cs_conn_shutw(cs, CO_SHW_SILENT);
|
||||||
|
@ -829,7 +829,7 @@ static int dns_session_init(struct appctx *appctx)
|
|||||||
|
|
||||||
s = appctx_strm(appctx);
|
s = appctx_strm(appctx);
|
||||||
s->scb->dst = addr;
|
s->scb->dst = addr;
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
s->target = &ds->dss->srv->obj_type;
|
s->target = &ds->dss->srv->obj_type;
|
||||||
s->flags = SF_ASSIGNED;
|
s->flags = SF_ASSIGNED;
|
||||||
|
|
||||||
|
@ -1119,7 +1119,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit)
|
|||||||
if (s->be->options & PR_O_ABRT_CLOSE) {
|
if (s->be->options & PR_O_ABRT_CLOSE) {
|
||||||
channel_auto_read(req);
|
channel_auto_read(req);
|
||||||
if ((req->flags & (CF_SHUTR|CF_READ_NULL)) && !(txn->flags & TX_CON_WANT_TUN))
|
if ((req->flags & (CF_SHUTR|CF_READ_NULL)) && !(txn->flags & TX_CON_WANT_TUN))
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
channel_auto_close(req);
|
channel_auto_close(req);
|
||||||
}
|
}
|
||||||
else if (s->txn->meth == HTTP_METH_POST) {
|
else if (s->txn->meth == HTTP_METH_POST) {
|
||||||
@ -1364,7 +1364,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
stream_inc_http_fail_ctr(s);
|
stream_inc_http_fail_ctr(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
http_reply_and_close(s, txn->status, http_error_message(s));
|
http_reply_and_close(s, txn->status, http_error_message(s));
|
||||||
|
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
if (!(s->flags & SF_ERR_MASK))
|
||||||
@ -1394,7 +1394,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
|
|
||||||
txn->status = 504;
|
txn->status = 504;
|
||||||
stream_inc_http_fail_ctr(s);
|
stream_inc_http_fail_ctr(s);
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
http_reply_and_close(s, txn->status, http_error_message(s));
|
http_reply_and_close(s, txn->status, http_error_message(s));
|
||||||
|
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
if (!(s->flags & SF_ERR_MASK))
|
||||||
@ -1451,7 +1451,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
|
|
||||||
txn->status = 502;
|
txn->status = 502;
|
||||||
stream_inc_http_fail_ctr(s);
|
stream_inc_http_fail_ctr(s);
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
http_reply_and_close(s, txn->status, http_error_message(s));
|
http_reply_and_close(s, txn->status, http_error_message(s));
|
||||||
|
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
if (!(s->flags & SF_ERR_MASK))
|
||||||
@ -1746,7 +1746,7 @@ int http_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
if (!(s->flags & SF_FINST_MASK))
|
if (!(s->flags & SF_FINST_MASK))
|
||||||
s->flags |= SF_FINST_H;
|
s->flags |= SF_FINST_H;
|
||||||
|
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
DBG_TRACE_DEVEL("leaving on error",
|
DBG_TRACE_DEVEL("leaving on error",
|
||||||
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn);
|
STRM_EV_STRM_ANA|STRM_EV_HTTP_ANA|STRM_EV_HTTP_ERR, s, txn);
|
||||||
return 0;
|
return 0;
|
||||||
@ -2056,7 +2056,7 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
|
|||||||
|
|
||||||
return_prx_cond:
|
return_prx_cond:
|
||||||
s->logs.t_data = -1; /* was not a valid response */
|
s->logs.t_data = -1; /* was not a valid response */
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
|
|
||||||
if (!(s->flags & SF_ERR_MASK))
|
if (!(s->flags & SF_ERR_MASK))
|
||||||
s->flags |= SF_ERR_PRXCOND;
|
s->flags |= SF_ERR_PRXCOND;
|
||||||
@ -4372,7 +4372,7 @@ static void http_end_request(struct stream *s)
|
|||||||
/* if the server closes the connection, we want to immediately react
|
/* if the server closes the connection, we want to immediately react
|
||||||
* and close the socket to save packets and syscalls.
|
* and close the socket to save packets and syscalls.
|
||||||
*/
|
*/
|
||||||
s->scb->flags |= CS_FL_NOHALF;
|
s->scb->flags |= SC_FL_NOHALF;
|
||||||
|
|
||||||
/* In any case we've finished parsing the request so we must
|
/* In any case we've finished parsing the request so we must
|
||||||
* disable Nagle when sending data because 1) we're not going
|
* disable Nagle when sending data because 1) we're not going
|
||||||
@ -4447,7 +4447,7 @@ static void http_end_request(struct stream *s)
|
|||||||
http_msg_closed:
|
http_msg_closed:
|
||||||
/* if we don't know whether the server will close, we need to hard close */
|
/* if we don't know whether the server will close, we need to hard close */
|
||||||
if (txn->rsp.flags & HTTP_MSGF_XFER_LEN)
|
if (txn->rsp.flags & HTTP_MSGF_XFER_LEN)
|
||||||
s->scb->flags |= CS_FL_NOLINGER; /* we want to close ASAP */
|
s->scb->flags |= SC_FL_NOLINGER; /* we want to close ASAP */
|
||||||
/* see above in MSG_DONE why we only do this in these states */
|
/* see above in MSG_DONE why we only do this in these states */
|
||||||
if (!(s->be->options & PR_O_ABRT_CLOSE))
|
if (!(s->be->options & PR_O_ABRT_CLOSE))
|
||||||
channel_dont_read(chn);
|
channel_dont_read(chn);
|
||||||
|
@ -1015,7 +1015,7 @@ static int httpclient_applet_init(struct appctx *appctx)
|
|||||||
s->scb->dst = addr;
|
s->scb->dst = addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
s->flags |= SF_ASSIGNED;
|
s->flags |= SF_ASSIGNED;
|
||||||
s->res.flags |= CF_READ_DONTWAIT;
|
s->res.flags |= CF_READ_DONTWAIT;
|
||||||
|
|
||||||
|
@ -1090,7 +1090,7 @@ static int peer_session_init(struct appctx *appctx)
|
|||||||
|
|
||||||
/* initiate an outgoing connection */
|
/* initiate an outgoing connection */
|
||||||
s->scb->dst = addr;
|
s->scb->dst = addr;
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
s->flags = SF_ASSIGNED;
|
s->flags = SF_ASSIGNED;
|
||||||
s->target = peer_session_target(peer, s);
|
s->target = peer_session_target(peer, s);
|
||||||
|
|
||||||
|
@ -2358,9 +2358,9 @@ int stream_set_backend(struct stream *s, struct proxy *be)
|
|||||||
proxy_inc_be_ctr(be);
|
proxy_inc_be_ctr(be);
|
||||||
|
|
||||||
/* assign new parameters to the stream from the new backend */
|
/* assign new parameters to the stream from the new backend */
|
||||||
s->scb->flags &= ~CS_FL_INDEP_STR;
|
s->scb->flags &= ~SC_FL_INDEP_STR;
|
||||||
if (be->options2 & PR_O2_INDEPSTR)
|
if (be->options2 & PR_O2_INDEPSTR)
|
||||||
s->scb->flags |= CS_FL_INDEP_STR;
|
s->scb->flags |= SC_FL_INDEP_STR;
|
||||||
|
|
||||||
if (tick_isset(be->timeout.serverfin))
|
if (tick_isset(be->timeout.serverfin))
|
||||||
s->scb->hcto = be->timeout.serverfin;
|
s->scb->hcto = be->timeout.serverfin;
|
||||||
|
@ -608,7 +608,7 @@ static int sink_forward_session_init(struct appctx *appctx)
|
|||||||
|
|
||||||
s = appctx_strm(appctx);
|
s = appctx_strm(appctx);
|
||||||
s->scb->dst = addr;
|
s->scb->dst = addr;
|
||||||
s->scb->flags |= CS_FL_NOLINGER;
|
s->scb->flags |= SC_FL_NOLINGER;
|
||||||
|
|
||||||
s->target = &sft->srv->obj_type;
|
s->target = &sft->srv->obj_type;
|
||||||
s->flags = SF_ASSIGNED;
|
s->flags = SF_ASSIGNED;
|
||||||
|
42
src/stream.c
42
src/stream.c
@ -449,7 +449,7 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer
|
|||||||
if (cs_attach_strm(s->scf, s) < 0)
|
if (cs_attach_strm(s->scf, s) < 0)
|
||||||
goto out_fail_attach_scf;
|
goto out_fail_attach_scf;
|
||||||
|
|
||||||
s->scb = cs_new_from_strm(s, CS_FL_ISBACK);
|
s->scb = cs_new_from_strm(s, SC_FL_ISBACK);
|
||||||
if (!s->scb)
|
if (!s->scb)
|
||||||
goto out_fail_alloc_scb;
|
goto out_fail_alloc_scb;
|
||||||
|
|
||||||
@ -457,11 +457,11 @@ struct stream *stream_new(struct session *sess, struct stconn *cs, struct buffer
|
|||||||
s->scf->hcto = sess->fe->timeout.clientfin;
|
s->scf->hcto = sess->fe->timeout.clientfin;
|
||||||
|
|
||||||
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
|
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
|
||||||
s->scf->flags |= CS_FL_INDEP_STR;
|
s->scf->flags |= SC_FL_INDEP_STR;
|
||||||
|
|
||||||
s->scb->hcto = TICK_ETERNITY;
|
s->scb->hcto = TICK_ETERNITY;
|
||||||
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
|
if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
|
||||||
s->scb->flags |= CS_FL_INDEP_STR;
|
s->scb->flags |= SC_FL_INDEP_STR;
|
||||||
|
|
||||||
if (sc_ep_test(cs, SE_FL_WEBSOCKET))
|
if (sc_ep_test(cs, SE_FL_WEBSOCKET))
|
||||||
s->flags |= SF_WEBSOCKET;
|
s->flags |= SF_WEBSOCKET;
|
||||||
@ -1660,8 +1660,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
rpf_last = res->flags & ~CF_MASK_ANALYSER;
|
rpf_last = res->flags & ~CF_MASK_ANALYSER;
|
||||||
|
|
||||||
/* we don't want the stream connector functions to recursively wake us up */
|
/* we don't want the stream connector functions to recursively wake us up */
|
||||||
scf->flags |= CS_FL_DONT_WAKE;
|
scf->flags |= SC_FL_DONT_WAKE;
|
||||||
scb->flags |= CS_FL_DONT_WAKE;
|
scb->flags |= SC_FL_DONT_WAKE;
|
||||||
|
|
||||||
/* update pending events */
|
/* update pending events */
|
||||||
s->pending_events |= (state & TASK_WOKEN_ANY);
|
s->pending_events |= (state & TASK_WOKEN_ANY);
|
||||||
@ -1681,26 +1681,26 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
channel_check_timeouts(req);
|
channel_check_timeouts(req);
|
||||||
|
|
||||||
if (unlikely((req->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
|
if (unlikely((req->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
|
||||||
scb->flags |= CS_FL_NOLINGER;
|
scb->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutw(scb);
|
cs_shutw(scb);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely((req->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
|
if (unlikely((req->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
|
||||||
if (scf->flags & CS_FL_NOHALF)
|
if (scf->flags & SC_FL_NOHALF)
|
||||||
scf->flags |= CS_FL_NOLINGER;
|
scf->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutr(scf);
|
cs_shutr(scf);
|
||||||
}
|
}
|
||||||
|
|
||||||
channel_check_timeouts(res);
|
channel_check_timeouts(res);
|
||||||
|
|
||||||
if (unlikely((res->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
|
if (unlikely((res->flags & (CF_SHUTW|CF_WRITE_TIMEOUT)) == CF_WRITE_TIMEOUT)) {
|
||||||
scf->flags |= CS_FL_NOLINGER;
|
scf->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutw(scf);
|
cs_shutw(scf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely((res->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
|
if (unlikely((res->flags & (CF_SHUTR|CF_READ_TIMEOUT)) == CF_READ_TIMEOUT)) {
|
||||||
if (scb->flags & CS_FL_NOHALF)
|
if (scb->flags & SC_FL_NOHALF)
|
||||||
scb->flags |= CS_FL_NOLINGER;
|
scb->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutr(scb);
|
cs_shutr(scb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1718,8 +1718,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
!(s->flags & SF_CONN_EXP) &&
|
!(s->flags & SF_CONN_EXP) &&
|
||||||
!((sc_ep_get(scf) | scb->flags) & SE_FL_ERROR) &&
|
!((sc_ep_get(scf) | scb->flags) & SE_FL_ERROR) &&
|
||||||
((s->pending_events & TASK_WOKEN_ANY) == TASK_WOKEN_TIMER)) {
|
((s->pending_events & TASK_WOKEN_ANY) == TASK_WOKEN_TIMER)) {
|
||||||
scf->flags &= ~CS_FL_DONT_WAKE;
|
scf->flags &= ~SC_FL_DONT_WAKE;
|
||||||
scb->flags &= ~CS_FL_DONT_WAKE;
|
scb->flags &= ~SC_FL_DONT_WAKE;
|
||||||
goto update_exp_and_leave;
|
goto update_exp_and_leave;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2309,7 +2309,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
if (unlikely((req->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW &&
|
if (unlikely((req->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW &&
|
||||||
channel_is_empty(req))) {
|
channel_is_empty(req))) {
|
||||||
if (req->flags & CF_READ_ERROR)
|
if (req->flags & CF_READ_ERROR)
|
||||||
scb->flags |= CS_FL_NOLINGER;
|
scb->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutw(scb);
|
cs_shutw(scb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2320,8 +2320,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
|
|
||||||
/* shutdown(read) pending */
|
/* shutdown(read) pending */
|
||||||
if (unlikely((req->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
|
if (unlikely((req->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
|
||||||
if (scf->flags & CS_FL_NOHALF)
|
if (scf->flags & SC_FL_NOHALF)
|
||||||
scf->flags |= CS_FL_NOLINGER;
|
scf->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutr(scf);
|
cs_shutr(scf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2445,8 +2445,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
|
|
||||||
/* shutdown(read) pending */
|
/* shutdown(read) pending */
|
||||||
if (unlikely((res->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
|
if (unlikely((res->flags & (CF_SHUTR|CF_SHUTR_NOW)) == CF_SHUTR_NOW)) {
|
||||||
if (scb->flags & CS_FL_NOHALF)
|
if (scb->flags & SC_FL_NOHALF)
|
||||||
scb->flags |= CS_FL_NOLINGER;
|
scb->flags |= SC_FL_NOLINGER;
|
||||||
cs_shutr(scb);
|
cs_shutr(scb);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2466,8 +2466,8 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
goto resync_request;
|
goto resync_request;
|
||||||
|
|
||||||
/* we're interested in getting wakeups again */
|
/* we're interested in getting wakeups again */
|
||||||
scf->flags &= ~CS_FL_DONT_WAKE;
|
scf->flags &= ~SC_FL_DONT_WAKE;
|
||||||
scb->flags &= ~CS_FL_DONT_WAKE;
|
scb->flags &= ~SC_FL_DONT_WAKE;
|
||||||
|
|
||||||
if (likely((scf->state != CS_ST_CLO) || !cs_state_in(scb->state, CS_SB_INI|CS_SB_CLO) ||
|
if (likely((scf->state != CS_ST_CLO) || !cs_state_in(scb->state, CS_SB_INI|CS_SB_CLO) ||
|
||||||
(req->analysers & AN_REQ_FLT_END) || (res->analysers & AN_RES_FLT_END))) {
|
(req->analysers & AN_REQ_FLT_END) || (res->analysers & AN_RES_FLT_END))) {
|
||||||
@ -2494,7 +2494,7 @@ struct task *process_stream(struct task *t, void *context, unsigned int state)
|
|||||||
s->pending_events = 0;
|
s->pending_events = 0;
|
||||||
|
|
||||||
update_exp_and_leave:
|
update_exp_and_leave:
|
||||||
/* Note: please ensure that if you branch here you disable CS_FL_DONT_WAKE */
|
/* Note: please ensure that if you branch here you disable SC_FL_DONT_WAKE */
|
||||||
t->expire = tick_first((tick_is_expired(t->expire, now_ms) ? 0 : t->expire),
|
t->expire = tick_first((tick_is_expired(t->expire, now_ms) ? 0 : t->expire),
|
||||||
tick_first(tick_first(req->rex, req->wex),
|
tick_first(tick_first(req->rex, req->wex),
|
||||||
tick_first(res->rex, res->wex)));
|
tick_first(res->rex, res->wex)));
|
||||||
|
@ -287,7 +287,7 @@ static enum act_return tcp_exec_action_silent_drop(struct act_rule *rule, struct
|
|||||||
* is present, returning with ERR will cause lingering to be disabled.
|
* is present, returning with ERR will cause lingering to be disabled.
|
||||||
*/
|
*/
|
||||||
if (strm)
|
if (strm)
|
||||||
strm->scf->flags |= CS_FL_NOLINGER;
|
strm->scf->flags |= SC_FL_NOLINGER;
|
||||||
|
|
||||||
if (conn->flags & CO_FL_FDLESS)
|
if (conn->flags & CO_FL_FDLESS)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -391,7 +391,7 @@ int tcp_inspect_response(struct stream *s, struct channel *rep, int an_bit)
|
|||||||
goto deny;
|
goto deny;
|
||||||
}
|
}
|
||||||
else if (rule->action == ACT_TCP_CLOSE) {
|
else if (rule->action == ACT_TCP_CLOSE) {
|
||||||
chn_prod(rep)->flags |= CS_FL_NOLINGER | CS_FL_NOHALF;
|
chn_prod(rep)->flags |= SC_FL_NOLINGER | SC_FL_NOHALF;
|
||||||
cs_must_kill_conn(chn_prod(rep));
|
cs_must_kill_conn(chn_prod(rep));
|
||||||
cs_shutr(chn_prod(rep));
|
cs_shutr(chn_prod(rep));
|
||||||
cs_shutw(chn_prod(rep));
|
cs_shutw(chn_prod(rep));
|
||||||
|
Loading…
Reference in New Issue
Block a user