src/session.c
static void sess_prepare_conn_req(struct session *s, struct stream_interface *si)
{
	DPRINTF(stderr,"[%u] %s: sess=%p rq=%p, rp=%p, exp(r,w)=%u,%u rqf=%08x rpf=%08x rqh=%d rqt=%d rph=%d rpt=%d cs=%d ss=%d\n",
		now_ms, __FUNCTION__,
		s,
		s->req, s->rep,
		s->req->rex, s->rep->wex,
		s->req->flags, s->rep->flags,
		s->req->buf->i, s->req->buf->o, s->rep->buf->i, s->rep->buf->o, s->rep->cons->state, s->req->cons->state);

	if (si->state != SI_ST_REQ)
		return;

	/* Try to assign a server */
	if (srv_redispatch_connect(s) != 0) {
		/* We did not get a server. Either we queued the
		 * connection request, or we encountered an error.
		 */
		if (si->state == SI_ST_QUE)
			return;

		/* we did not get any server, let's check the cause */
		si_shutr(si);
		si_shutw(si);
		si->ob->flags |= CF_WRITE_ERROR;
		if (!si->err_type)
			si->err_type = SI_ET_CONN_OTHER;
		si->state = SI_ST_CLO;
		if (s->srv_error)
			s->srv_error(s, si);
		return;
	}

	/* The server is assigned */
	s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
	si->state = SI_ST_ASS;
}
/* This function initiates a server connection request on a stream interface
 * already in SI_ST_REQ state. Upon success, the state goes to SI_ST_ASS,
 * indicating that a server has been assigned. It may also return SI_ST_QUE,
 * or SI_ST_CLO upon error.
 */
This function initiates a server connection request on a stream interface
already in SI_ST_REQ state. Upon success, the state goes to SI_ST_ASS,
indicating that a server has been assigned. It may also return SI_ST_QUE,
or SI_ST_CLO upon error.
This function initiates a server connection request on a stream interface already in SI_ST_REQ state . Upon success the state goes to SI_ST_ASS indicating that a server has been assigned . It may also return SI_ST_QUE or SI_ST_CLO upon error .
static void sess_prepare_conn_req(struct session *s, struct stream_interface *si)
{
	DPRINTF(stderr,"[%u] %s: sess=%p rq=%p, rp=%p, exp(r,w)=%u,%u rqf=%08x rpf=%08x rqh=%d rqt=%d rph=%d rpt=%d cs=%d ss=%d\n",
		now_ms, __FUNCTION__,
		s,
		s->req, s->rep,
		s->req->rex, s->rep->wex,
		s->req->flags, s->rep->flags,
		s->req->buf->i, s->req->buf->o, s->rep->buf->i, s->rep->buf->o, s->rep->cons->state, s->req->cons->state);
	if (si->state != SI_ST_REQ)
		return;
	if (srv_redispatch_connect(s) != 0) {
		if (si->state == SI_ST_QUE)
			return;
		si_shutr(si);
		si_shutw(si);
		si->ob->flags |= CF_WRITE_ERROR;
		if (!si->err_type)
			si->err_type = SI_ET_CONN_OTHER;
		si->state = SI_ST_CLO;
		if (s->srv_error)
			s->srv_error(s, si);
		return;
	}
	s->logs.t_queue = tv_ms_elapsed(&s->logs.tv_accept, &now);
	si->state = SI_ST_ASS;
}
static void sess_prepare_conn_req ( struct session * s , struct stream_interface * si ) { DPRINTF ( stderr , " \n " , now_ms , __FUNCTION__ , s , s -> req , s -> rep , s -> req -> rex , s -> rep -> wex , s -> req -> flags , s -> rep -> flags , s -> req -> buf -> i , s -> req -> buf -> o , s -> rep -> buf -> i , s -> rep -> buf -> o , s -> rep -> cons -> state , s -> req -> cons -> state ) ; if ( si -> state != SI_ST_REQ ) return ; if ( srv_redispatch_connect ( s ) != 0 ) { if ( si -> state == SI_ST_QUE ) return ; si_shutr ( si ) ; si_shutw ( si ) ; si -> ob -> flags |= CF_WRITE_ERROR ; if ( ! si -> err_type ) si -> err_type = SI_ET_CONN_OTHER ; si -> state = SI_ST_CLO ; if ( s -> srv_error ) s -> srv_error ( s , si ) ; return ; } s -> logs . t_queue = tv_ms_elapsed ( & s -> logs . tv_accept , & now ) ; si -> state = SI_ST_ASS ; }
This function initiates a server connection request on a stream interface
 already in SI_ST_REQ state.
This function initiates a server connection request on a stream interface already in SI_ST_REQ state .
/* Try to assign a server */ /* We did not get a server. Either we queued the
		 * connection request, or we encountered an error.
		 */ /* we did not get any server, let's check the cause */ /* The server is assigned */