if ((s->req = pool_alloc2(pool2_channel)) == NULL)
goto out_fail_req; /* no memory */
- if (unlikely(b_alloc(&s->req->buf) == NULL))
- goto out_fail_req_buf; /* no memory */
-
channel_init(s->req);
s->req->prod = &s->si[0];
s->req->cons = &s->si[1];
s->req->rto = s->fe->timeout.client;
s->req->wto = s->be->timeout.server;
+ if (unlikely(b_alloc(&s->req->buf) == NULL))
+ goto out_fail_req_buf; /* no memory */
+
if ((s->rep = pool_alloc2(pool2_channel)) == NULL)
goto out_fail_rep; /* no memory */
- if (unlikely(b_alloc(&s->rep->buf) == NULL))
- goto out_fail_rep_buf; /* no memory */
-
channel_init(s->rep);
s->rep->prod = &s->si[1];
s->rep->cons = &s->si[0];
t->expire = TICK_ETERNITY;
s->rep->flags |= CF_READ_DONTWAIT;
+
+ if (unlikely(b_alloc(&s->rep->buf) == NULL))
+ goto out_fail_rep_buf; /* no memory */
+
/* it is important not to call the wakeup function directly but to
* pass through task_wakeup(), because this one knows how to apply
* priorities to tasks.
if (unlikely((s->req = pool_alloc2(pool2_channel)) == NULL))
goto out_free_task; /* no memory */
- if (unlikely(b_alloc(&s->req->buf) == NULL))
- goto out_free_req; /* no memory */
-
- if (unlikely((s->rep = pool_alloc2(pool2_channel)) == NULL))
- goto out_free_req_buf; /* no memory */
-
- if (unlikely(b_alloc(&s->rep->buf) == NULL))
- goto out_free_rep; /* no memory */
-
channel_init(s->req);
s->req->prod = &s->si[0];
s->req->cons = &s->si[1];
s->req->wex = TICK_ETERNITY;
s->req->analyse_exp = TICK_ETERNITY;
+ if (unlikely(b_alloc(&s->req->buf) == NULL))
+ goto out_free_req; /* no memory */
+
+ if (unlikely((s->rep = pool_alloc2(pool2_channel)) == NULL))
+ goto out_free_req_buf; /* no memory */
+
channel_init(s->rep);
s->rep->prod = &s->si[1];
s->rep->cons = &s->si[0];
s->rep->wex = TICK_ETERNITY;
s->rep->analyse_exp = TICK_ETERNITY;
+ if (unlikely(b_alloc(&s->rep->buf) == NULL))
+ goto out_free_rep; /* no memory */
+
txn = &s->txn;
/* Those variables will be checked and freed if non-NULL in
* session.c:session_free(). It is important that they are