s->be->lbprm.server_take_conn(s->srv);
}
- s->req->cex = tick_add_ifset(now_ms, s->be->timeout.connect);
+ s->req->wex = tick_add_ifset(now_ms, s->be->timeout.connect);
return SN_ERR_NONE; /* connection is OK */
}
if (t->conn_retries < 0) {
/* if not retryable anymore, let's abort */
- t->req->cex = TICK_ETERNITY;
+ t->req->wex = TICK_ETERNITY;
srv_close_with_err(t, conn_err, SN_FINST_C,
503, error_message(t, HTTP_ERR_503));
if (t->srv)
return 1;
case SN_ERR_INTERNAL:
- t->req->cex = TICK_ETERNITY;
+ t->req->wex = TICK_ETERNITY;
srv_close_with_err(t, SN_ERR_INTERNAL, SN_FINST_C,
500, error_message(t, HTTP_ERR_500));
if (t->srv)
goto redispatch;
}
- t->req->cex = TICK_ETERNITY;
+ t->req->wex = TICK_ETERNITY;
srv_close_with_err(t, SN_ERR_SRVTO, SN_FINST_Q,
503, error_message(t, HTTP_ERR_503));
case SRV_STATUS_NOSRV:
/* note: it is guaranteed that t->srv == NULL here */
- t->req->cex = TICK_ETERNITY;
+ t->req->wex = TICK_ETERNITY;
srv_close_with_err(t, SN_ERR_SRVTO, SN_FINST_C,
503, error_message(t, HTTP_ERR_503));
return 1;
case SRV_STATUS_QUEUED:
- t->req->cex = tick_add_ifset(now_ms, t->be->timeout.queue);
+ t->req->wex = tick_add_ifset(now_ms, t->be->timeout.queue);
t->srv_state = SV_STIDLE;
/* do nothing else and do not wake any other session up */
return 1;
case SRV_STATUS_INTERNAL:
default:
- t->req->cex = TICK_ETERNITY;
+ t->req->wex = TICK_ETERNITY;
srv_close_with_err(t, SN_ERR_INTERNAL, SN_FINST_C,
500, error_message(t, HTTP_ERR_500));
if (t->srv)
*/
if ((s->rep->flags & (BF_MAY_FORWARD|BF_SHUTR)) == 0 &&
- (tick_isset(s->req->cex) || tick_isset(s->req->wex) || tick_isset(s->rep->rex)))
+ (tick_isset(s->req->wex) || tick_isset(s->rep->rex)))
s->req->rex = TICK_ETERNITY;
t->expire = tick_first(tick_first(s->req->rex, s->req->wex),
tick_first(s->rep->rex, s->rep->wex));
- t->expire = tick_first(t->expire, s->req->cex);
if (s->analysis & AN_REQ_ANY) {
if (s->analysis & AN_REQ_INSPECT)
t->expire = tick_first(t->expire, s->inspect_exp);
/* flush the request so that we can drop the connection early
* if the client closes first.
*/
- req->cex = tick_add_ifset(now_ms, t->be->timeout.tarpit);
- if (!req->cex)
- req->cex = now_ms;
+ req->wex = tick_add_ifset(now_ms, t->be->timeout.tarpit);
+ if (!req->wex)
+ req->wex = now_ms;
}
/* OK let's go on with the BODY now */
if ((rep->flags & BF_SHUTW) ||
((req->flags & BF_SHUTR) &&
(req->flags & BF_EMPTY || t->be->options & PR_O_ABRT_CLOSE))) { /* give up */
- req->cex = TICK_ETERNITY;
+ req->wex = TICK_ETERNITY;
if (t->pend_pos)
t->logs.t_queue = tv_ms_elapsed(&t->logs.tv_accept, &now);
/* note that this must not return any error because it would be able to
* already set the connect expiration date to the right
* timeout. We just have to check that it has not expired.
*/
- if (!tick_is_expired(req->cex, now_ms))
+ if (!tick_is_expired(req->wex, now_ms))
return 0;
/* We will set the queue timer to the time spent, just for
* It will not cause trouble to the logs because we can exclude
* the tarpitted connections by filtering on the 'PT' status flags.
*/
- req->cex = TICK_ETERNITY;
+ req->wex = TICK_ETERNITY;
t->logs.t_queue = tv_ms_elapsed(&t->logs.tv_accept, &now);
srv_close_with_err(t, SN_ERR_PRXCOND, SN_FINST_T,
500, error_message(t, HTTP_ERR_500));
* to any other session to release it and wake us up again.
*/
if (t->pend_pos) {
- if (!tick_is_expired(req->cex, now_ms)) {
+ if (!tick_is_expired(req->wex, now_ms)) {
return 0;
} else {
/* we've been waiting too long here */
- req->cex = TICK_ETERNITY;
+ req->wex = TICK_ETERNITY;
t->logs.t_queue = tv_ms_elapsed(&t->logs.tv_accept, &now);
srv_close_with_err(t, SN_ERR_SRVTO, SN_FINST_Q,
503, error_message(t, HTTP_ERR_503));
((req->flags & BF_SHUTR) &&
((req->flags & BF_EMPTY && !(req->flags & BF_WRITE_STATUS)) ||
t->be->options & PR_O_ABRT_CLOSE))) { /* give up */
- req->cex = TICK_ETERNITY;
+ req->wex = TICK_ETERNITY;
if (!(t->flags & SN_CONN_TAR)) {
/* if we are in turn-around, we have already closed the FD */
fd_delete(t->srv_fd);
trace_term(t, TT_HTTP_SRV_5);
goto update_state;
}
- if (!(req->flags & BF_WRITE_STATUS) && !tick_is_expired(req->cex, now_ms)) {
+ if (!(req->flags & BF_WRITE_STATUS) && !tick_is_expired(req->wex, now_ms)) {
return 0; /* nothing changed */
}
else if (!(req->flags & BF_WRITE_STATUS) || (req->flags & BF_WRITE_ERROR)) {
/* timeout, asynchronous connect error or first write error */
if (t->flags & SN_CONN_TAR) {
/* We are doing a turn-around waiting for a new connection attempt. */
- if (!tick_is_expired(req->cex, now_ms))
+ if (!tick_is_expired(req->wex, now_ms))
return 0;
t->flags &= ~SN_CONN_TAR;
}
* time of 1 second. We will wait in the previous if block.
*/
t->flags |= SN_CONN_TAR;
- req->cex = tick_add(now_ms, MS_TO_TICKS(1000));
+ req->wex = tick_add(now_ms, MS_TO_TICKS(1000));
return 0;
}
}
t->srv_state = SV_STDATA;
if (!(t->analysis & AN_RTR_ANY))
t->rep->flags |= BF_MAY_FORWARD;
- req->cex = TICK_ETERNITY;
+ req->wex = TICK_ETERNITY;
goto update_state;
} /* else no error or write 0 */
}