/* below we have all handshake flags grouped into one */
CO_FL_HANDSHAKE = CO_FL_SEND_PROXY | CO_FL_ACCEPT_PROXY | CO_FL_ACCEPT_CIP | CO_FL_SOCKS4_SEND | CO_FL_SOCKS4_RECV,
+ CO_FL_WAIT_XPRT = CO_FL_WAIT_L4_CONN | CO_FL_HANDSHAKE | CO_FL_WAIT_L6_CONN,
CO_FL_SSL_WAIT_HS = 0x08000000, /* wait for an SSL handshake to complete */
tmpsrv->nbpend + 1 < s->be->max_ka_queue))) &&
srv_currently_usable(tmpsrv)) {
list_for_each_entry(conn, &srv_list->conn_list, session_list) {
- if (!(conn->flags & CO_FL_WAIT_L4L6)) {
+ if (!(conn->flags & CO_FL_WAIT_XPRT)) {
srv = tmpsrv;
s->target = &srv->obj_type;
goto out_ok;
}
}
- if (((!reuse || (srv_conn && (srv_conn->flags & CO_FL_WAIT_L4L6)))
+ if (((!reuse || (srv_conn && (srv_conn->flags & CO_FL_WAIT_XPRT)))
&& ha_used_fds > global.tune.pool_high_count) && srv && srv->idle_orphan_conns) {
struct connection *tokill_conn;
}
/* first, let's see if we've made any progress on this connection */
- if (!conn->mux && !(conn->flags & CO_FL_WAIT_L4L6)) {
+ if (!conn->mux && !(conn->flags & CO_FL_WAIT_XPRT)) {
/* connection finished to set up */
struct server *srv;
}
/* the rest of the code below expects the connection to be ready! */
- if (conn->flags & CO_FL_WAIT_L4L6 && !done)
+ if (conn->flags & CO_FL_WAIT_XPRT && !done)
goto wait_more_data;
/* Intermediate or complete response received.
default:
/* good connection is enough for pure TCP check */
- if (!(conn->flags & CO_FL_WAIT_L4L6) && !check->type) {
+ if (!(conn->flags & CO_FL_WAIT_XPRT) && !check->type) {
if (check->use_ssl)
set_server_check_status(check, HCHK_STATUS_L6OK, NULL);
else
chk_report_conn_err(check, errno, 0);
task_wakeup(check->task, TASK_WOKEN_IO);
}
- else if (!(conn->flags & CO_FL_HANDSHAKE) && !check->type) {
+ else if (!(conn->flags & CO_FL_WAIT_XPRT) && !check->type) {
/* we may get here if only a connection probe was required : we
* don't have any data to send nor anything expected in response,
* so the completion of the connection establishment is enough.
* sending since otherwise we won't be woken up.
*/
__event_srv_chk_w(cs);
- if (!(conn->flags & CO_FL_WAIT_L4_CONN) ||
+ if (!(conn->flags & CO_FL_WAIT_XPRT) ||
!(check->wait_list.events & SUB_RETRY_SEND))
__event_srv_chk_r(cs);
}
*/
if (check->result == CHK_RES_UNKNOWN) {
/* good connection is enough for pure TCP check */
- if (!(conn->flags & CO_FL_WAIT_L4L6) && !check->type) {
+ if (!(conn->flags & CO_FL_WAIT_XPRT) && !check->type) {
if (check->use_ssl)
set_server_check_status(check, HCHK_STATUS_L6OK, NULL);
else
next = LIST_NEXT(&next->list, struct tcpcheck_rule *, list);
if ((check->current_step || &next->list == head) &&
- (conn->flags & (CO_FL_WAIT_L4L6 | CO_FL_HANDSHAKE))) {
+ (conn->flags & CO_FL_WAIT_XPRT)) {
/* we allow up to min(inter, timeout.connect) for a connection
* to establish but only when timeout.check is set
* as it may be to short for a full check otherwise
break;
/* don't do anything until the connection is established */
- if (conn->flags & CO_FL_WAIT_L4L6)
+ if (conn->flags & CO_FL_WAIT_XPRT)
break;
} /* end 'connect' */
} /* end loop over double chained step list */
/* don't do anything until the connection is established */
- if (conn->flags & CO_FL_WAIT_L4L6) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
/* update expire time, should be done by process_chk */
/* we allow up to min(inter, timeout.connect) for a connection
* to establish but only when timeout.check is set
* informations to create one, typically from the ALPN. If we're
* done with the handshake, attempt to create one.
*/
- if (unlikely(!conn->mux) && !(conn->flags & CO_FL_HANDSHAKE))
+ if (unlikely(!conn->mux) && !(conn->flags & CO_FL_WAIT_XPRT))
if (conn_create_mux(conn) < 0)
return;
* Note that the wake callback is allowed to release the connection and
* the fd (and return < 0 in this case).
*/
- if ((io_available || (((conn->flags ^ flags) & CO_FL_NOTIFY_DONE) ||
- ((flags & (CO_FL_WAIT_L4L6|CO_FL_HANDSHAKE)) &&
- (conn->flags & (CO_FL_WAIT_L4L6|CO_FL_HANDSHAKE)) == 0))) &&
+ if ((io_available || ((conn->flags ^ flags) & CO_FL_NOTIFY_DONE) ||
+ ((flags & CO_FL_WAIT_XPRT) && !(conn->flags & CO_FL_WAIT_XPRT))) &&
conn->mux && conn->mux->wake && conn->mux->wake(conn) < 0)
return;
if (!conn)
return 0;
- if (conn->flags & CO_FL_WAIT_L4L6) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
if (!conn)
return 0;
- if (conn->flags & CO_FL_WAIT_L4L6) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
}
- if (conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN)) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
/* a handshake was requested */
goto schedule;
}
* any stream that was waiting for it.
*/
if (!(fconn->flags & FCGI_CF_WAIT_FOR_HS) &&
- (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_HANDSHAKE | CO_FL_EARLY_DATA)) == CO_FL_EARLY_DATA) {
+ (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_WAIT_XPRT | CO_FL_EARLY_DATA)) == CO_FL_EARLY_DATA) {
struct eb32_node *node;
struct fcgi_strm *fstrm;
int ret = 0;
switch (mux_ctl) {
case MUX_STATUS:
- if (!(conn->flags & CO_FL_WAIT_L4L6))
+ if (!(conn->flags & CO_FL_WAIT_XPRT))
ret |= MUX_STATUS_READY;
return ret;
default:
* now, as we don't want to remove everything from the channel buffer
* before we're sure we can send it.
*/
- if (h1c->conn->flags & (CO_FL_WAIT_L4L6|CO_FL_HANDSHAKE)) {
+ if (h1c->conn->flags & CO_FL_WAIT_XPRT) {
TRACE_LEAVE(H1_EV_STRM_SEND, h1c->conn, h1s);
return 0;
}
int ret = 0;
switch (mux_ctl) {
case MUX_STATUS:
- if (!(conn->flags & CO_FL_WAIT_L4L6))
+ if (!(conn->flags & CO_FL_WAIT_XPRT))
ret |= MUX_STATUS_READY;
return ret;
default:
return 1;
}
- if (conn->flags & (CO_FL_HANDSHAKE|CO_FL_WAIT_L4_CONN|CO_FL_WAIT_L6_CONN)) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
/* a handshake was requested */
goto schedule;
}
* any stream that was waiting for it.
*/
if (!(h2c->flags & H2_CF_WAIT_FOR_HS) &&
- (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_HANDSHAKE | CO_FL_EARLY_DATA)) == CO_FL_EARLY_DATA) {
+ (conn->flags & (CO_FL_EARLY_SSL_HS | CO_FL_WAIT_XPRT | CO_FL_EARLY_DATA)) == CO_FL_EARLY_DATA) {
struct eb32_node *node;
struct h2s *h2s;
/* If we had early data, and we're done with the handshake
* then whe know the data are safe, and we can remove the flag.
*/
- if ((conn->flags & (CO_FL_EARLY_DATA | CO_FL_EARLY_SSL_HS | CO_FL_HANDSHAKE)) ==
+ if ((conn->flags & (CO_FL_EARLY_DATA | CO_FL_EARLY_SSL_HS | CO_FL_WAIT_XPRT)) ==
CO_FL_EARLY_DATA)
conn->flags &= ~CO_FL_EARLY_DATA;
return ret;
int ret = 0;
switch (mux_ctl) {
case MUX_STATUS:
- if (!(conn->flags & CO_FL_WAIT_L4L6))
+ if (!(conn->flags & CO_FL_WAIT_XPRT))
ret |= MUX_STATUS_READY;
return ret;
default:
* v | | |
* conn -- owner ---> task <-----+
*/
- if (cli_conn->flags & (CO_FL_HANDSHAKE | CO_FL_EARLY_SSL_HS)) {
+ if (cli_conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)) {
if (unlikely((sess->task = task_new(tid_bit)) == NULL))
goto out_free_sess;
}
#endif
- if (conn->flags & (CO_FL_HANDSHAKE | CO_FL_SSL_WAIT_HS))
+ if (conn->flags & (CO_FL_WAIT_XPRT | CO_FL_SSL_WAIT_HS))
/* a handshake was requested */
return 0;
if (!ctx)
goto out_error;
- if (conn->flags & (CO_FL_HANDSHAKE | CO_FL_SSL_WAIT_HS | CO_FL_EARLY_SSL_HS))
+ if (conn->flags & (CO_FL_WAIT_XPRT | CO_FL_SSL_WAIT_HS | CO_FL_EARLY_SSL_HS))
/* a handshake was requested */
return 0;
{
struct ssl_sock_ctx *ctx = xprt_ctx;
- if (conn->flags & (CO_FL_HANDSHAKE | CO_FL_SSL_WAIT_HS))
+ if (conn->flags & (CO_FL_WAIT_XPRT | CO_FL_SSL_WAIT_HS))
return;
if (!clean)
/* don't sent notify on SSL_shutdown */
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags |= SMP_F_MAY_CHANGE;
return 0;
}
return 0;
ctx = conn->xprt_ctx;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags = SMP_F_MAY_CHANGE;
return 0;
}
if (!conn || conn->xprt != &ssl_sock)
return 0;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags = SMP_F_MAY_CHANGE;
return 0;
}
if (!conn || conn->xprt != &ssl_sock)
return 0;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags = SMP_F_MAY_CHANGE;
return 0;
}
if (!conn || conn->xprt != &ssl_sock)
return 0;
- if (conn->flags & CO_FL_WAIT_L6_CONN) {
+ if (conn->flags & CO_FL_WAIT_XPRT) {
smp->flags = SMP_F_MAY_CHANGE;
return 0;
}
struct connection *conn = objt_cs(si->end) ? objt_cs(si->end)->conn : NULL;
if (((oc->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW) &&
- (si->state == SI_ST_EST) && (!conn || !(conn->flags & (CO_FL_HANDSHAKE | CO_FL_EARLY_SSL_HS))))
+ (si->state == SI_ST_EST) && (!conn || !(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS))))
si_shutw(si);
oc->wex = TICK_ETERNITY;
}
* in the event there's an analyser waiting for the end of
* the handshake.
*/
- if (!(conn->flags & (CO_FL_HANDSHAKE | CO_FL_EARLY_SSL_HS)) &&
+ if (!(conn->flags & (CO_FL_WAIT_XPRT | CO_FL_EARLY_SSL_HS)) &&
(cs->flags & CS_FL_WAIT_FOR_HS)) {
cs->flags &= ~CS_FL_WAIT_FOR_HS;
task_wakeup(si_task(si), TASK_WOKEN_MSG);
}
if (!si_state_in(si->state, SI_SB_EST|SI_SB_DIS|SI_SB_CLO) &&
- (conn->flags & (CO_FL_WAIT_L4L6 | CO_FL_HANDSHAKE)) == 0) {
+ (conn->flags & CO_FL_WAIT_XPRT) == 0) {
si->exp = TICK_ETERNITY;
oc->flags |= CF_WRITE_NULL;
if (si->state == SI_ST_CON)