si->err_type = SI_ET_NONE;
si->conn_retries = 0; /* used for logging too */
si->exp = TICK_ETERNITY;
- si->flags = SI_FL_NONE;
+ si->flags &= SI_FL_ISBACK;
si->end = NULL;
si->state = si->prev_state = SI_ST_INI;
}
SI_FL_ERR = 0x0002, /* a non-recoverable error has occurred */
SI_FL_WAIT_ROOM = 0x0004, /* waiting for space to store incoming data */
SI_FL_WAIT_DATA = 0x0008, /* waiting for more data to send */
- /* unused 0x0010 */
+ SI_FL_ISBACK = 0x0010, /* 0 for front-side SI, 1 for back-side */
SI_FL_DONT_WAKE = 0x0020, /* resync in progress, don't wake up */
SI_FL_INDEP_STR = 0x0040, /* independent streams = don't update rex on write */
SI_FL_NOLINGER = 0x0080, /* may close without lingering. One-shot. */
channel_auto_connect(&socket->s->req); /* don't wait to establish connection */
channel_auto_close(&socket->s->req); /* let the producer forward close requests */
+ socket->s->si[0].flags = SI_FL_NONE;
si_reset(&socket->s->si[0], socket->s->task);
si_set_state(&socket->s->si[0], SI_ST_EST); /* connection established (resource exists) */
* and retrieve data from the server. The connection is initialized
* with the "struct server".
*/
+ socket->s->si[1].flags = SI_FL_ISBACK;
si_reset(&socket->s->si[1], socket->s->task);
si_set_state(&socket->s->si[1], SI_ST_INI);
socket->s->si[1].conn_retries = socket_proxy.conn_retries;
s->be = s->fe = p;
s->req.buf = s->res.buf = NULL;
+ s->si[0].flags = SI_FL_NONE;
+ s->si[1].flags = SI_FL_ISBACK;
+
si_reset(&s->si[0], t);
si_set_state(&s->si[0], SI_ST_EST);
s->req.cons->err_type = SI_ET_NONE;
s->req.cons->conn_retries = 0; /* used for logging too */
s->req.cons->exp = TICK_ETERNITY;
- s->req.cons->flags &= SI_FL_DONT_WAKE; /* we're in the context of process_session */
+ s->req.cons->flags &= SI_FL_ISBACK | SI_FL_DONT_WAKE; /* we're in the context of process_session */
s->req.flags &= ~(CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CONNECT|CF_WRITE_ERROR|CF_STREAMER|CF_STREAMER_FAST|CF_NEVER_WAIT|CF_WAKE_CONNECT|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);
s->flags &= ~(SN_DIRECT|SN_ASSIGNED|SN_ADDR_SET|SN_BE_ASSIGNED|SN_FORCE_PRST|SN_IGNORE_PRST);
s->listener = l;
s->fe = p;
+ s->si[0].flags = SI_FL_NONE;
+ s->si[1].flags = SI_FL_ISBACK;
+
/* On a mini-session, the connection is directly attached to the
* session's target so that we don't need to initialize the stream
* interfaces. Another benefit is that it's easy to detect a mini-