s->req->flags &= BF_CLEAR_READ & BF_CLEAR_WRITE & BF_CLEAR_TIMEOUT;
s->rep->flags &= BF_CLEAR_READ & BF_CLEAR_WRITE & BF_CLEAR_TIMEOUT;
s->si[0].prev_state = s->si[0].state;
- s->si[0].flags = SI_FL_NONE;
+ s->si[0].flags &= ~(SI_FL_ERR|SI_FL_EXP);
/* Trick: if a request is being waiting for the server to respond,
* and if we know the server can timeout, we don't want the timeout
s->rep->flags &= BF_CLEAR_READ & BF_CLEAR_WRITE & BF_CLEAR_TIMEOUT;
s->si[0].prev_state = s->si[0].state;
s->si[1].prev_state = s->si[1].state;
- s->si[0].flags = s->si[1].flags = SI_FL_NONE;
+ s->si[0].flags &= ~(SI_FL_ERR|SI_FL_EXP);
+ s->si[1].flags &= ~(SI_FL_ERR|SI_FL_EXP);
/* Trick: if a request is being waiting for the server to respond,
* and if we know the server can timeout, we don't want the timeout
/* Not anymore room to store data. This should theorically
* never happen, but better safe than sorry !
*/
+ si->flags |= SI_FL_WAIT_ROOM;
b->flags |= BF_FULL;
EV_FD_CLR(fd, DIR_RD);
b->rex = TICK_ETERNITY;
b->xfer_large = 0;
}
+ si->flags |= SI_FL_WAIT_ROOM;
b->flags |= BF_FULL;
EV_FD_CLR(fd, DIR_RD);
b->rex = TICK_ETERNITY;
* anything. Theorically we cannot get there, but just in case,
* let's disable the write event and pretend we never came there.
*/
+ si->flags |= SI_FL_WAIT_DATA;
EV_FD_CLR(fd, DIR_WR);
b->wex = TICK_ETERNITY;
goto out_wakeup;
}
}
+ si->flags |= SI_FL_WAIT_DATA;
EV_FD_CLR(fd, DIR_WR);
b->wex = TICK_ETERNITY;
goto out_wakeup;
return;
si->ob->flags |= BF_SHUTW;
si->ob->wex = TICK_ETERNITY;
+ si->flags &= ~SI_FL_WAIT_DATA;
switch (si->state) {
case SI_ST_EST:
}
/* fall through */
case SI_ST_CON:
+ si->flags &= ~SI_FL_WAIT_ROOM;
/* we may have to close a pending connection, and mark the
* response buffer as shutr
*/
return;
si->ib->flags |= BF_SHUTR;
si->ib->rex = TICK_ETERNITY;
+ si->flags &= ~SI_FL_WAIT_ROOM;
if (si->state != SI_ST_EST && si->state != SI_ST_CON)
return;
/* Read not closed, update FD status and timeout for reads */
if (ib->flags & (BF_FULL|BF_HIJACK)) {
/* stop reading */
+ if ((ib->flags & (BF_FULL|BF_HIJACK)) == BF_FULL)
+ si->flags |= SI_FL_WAIT_ROOM;
EV_FD_COND_C(fd, DIR_RD);
ib->rex = TICK_ETERNITY;
}
* everytime we get here, otherwise it would risk never to expire. We only
* update it if is was not yet set, or if we already got some read status.
*/
+ si->flags &= ~SI_FL_WAIT_ROOM;
EV_FD_COND_S(fd, DIR_RD);
if (!(ib->flags & BF_READ_NOEXP) &&
(!tick_isset(ib->rex) || ib->flags & BF_READ_ACTIVITY))
if ((ob->flags & BF_EMPTY) ||
(ob->flags & (BF_HIJACK|BF_WRITE_ENA)) == 0) {
/* stop writing */
+ if ((ob->flags & (BF_EMPTY|BF_HIJACK|BF_WRITE_ENA)) == (BF_EMPTY|BF_WRITE_ENA))
+ si->flags |= SI_FL_WAIT_DATA;
EV_FD_COND_C(fd, DIR_WR);
ob->wex = TICK_ETERNITY;
}
* everytime we get here, otherwise it would risk never to expire. We only
* update it if is was not yet set, or if we already got some write status.
*/
+ si->flags &= ~SI_FL_WAIT_DATA;
EV_FD_COND_S(fd, DIR_WR);
if (!tick_isset(ob->wex) || ob->flags & BF_WRITE_ACTIVITY) {
ob->wex = tick_add_ifset(now_ms, ob->wto);