mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 15:47:01 +02:00
[OPTIM] stream_sock: don't clear FDs that are already cleared
We can on average two calls to __fd_clr() per session by avoiding to call it unnecessarily.
This commit is contained in:
parent
2f976e18b8
commit
11f49408f2
@ -938,11 +938,13 @@ void stream_sock_data_finish(struct stream_interface *si)
|
|||||||
/* Read not closed, update FD status and timeout for reads */
|
/* Read not closed, update FD status and timeout for reads */
|
||||||
if (ib->flags & (BF_FULL|BF_HIJACK|BF_DONT_READ)) {
|
if (ib->flags & (BF_FULL|BF_HIJACK|BF_DONT_READ)) {
|
||||||
/* stop reading */
|
/* stop reading */
|
||||||
|
if (!(si->flags & SI_FL_WAIT_ROOM)) {
|
||||||
if ((ib->flags & (BF_FULL|BF_HIJACK|BF_DONT_READ)) == BF_FULL)
|
if ((ib->flags & (BF_FULL|BF_HIJACK|BF_DONT_READ)) == BF_FULL)
|
||||||
si->flags |= SI_FL_WAIT_ROOM;
|
si->flags |= SI_FL_WAIT_ROOM;
|
||||||
EV_FD_COND_C(fd, DIR_RD);
|
EV_FD_COND_C(fd, DIR_RD);
|
||||||
ib->rex = TICK_ETERNITY;
|
ib->rex = TICK_ETERNITY;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* (re)start reading and update timeout. Note: we don't recompute the timeout
|
/* (re)start reading and update timeout. Note: we don't recompute the timeout
|
||||||
* everytime we get here, otherwise it would risk never to expire. We only
|
* everytime we get here, otherwise it would risk never to expire. We only
|
||||||
@ -961,11 +963,13 @@ void stream_sock_data_finish(struct stream_interface *si)
|
|||||||
/* Write not closed, update FD status and timeout for writes */
|
/* Write not closed, update FD status and timeout for writes */
|
||||||
if (ob->flags & BF_OUT_EMPTY) {
|
if (ob->flags & BF_OUT_EMPTY) {
|
||||||
/* stop writing */
|
/* stop writing */
|
||||||
|
if (!(si->flags & SI_FL_WAIT_DATA)) {
|
||||||
if ((ob->flags & (BF_FULL|BF_HIJACK|BF_SHUTW_NOW)) == 0)
|
if ((ob->flags & (BF_FULL|BF_HIJACK|BF_SHUTW_NOW)) == 0)
|
||||||
si->flags |= SI_FL_WAIT_DATA;
|
si->flags |= SI_FL_WAIT_DATA;
|
||||||
EV_FD_COND_C(fd, DIR_WR);
|
EV_FD_COND_C(fd, DIR_WR);
|
||||||
ob->wex = TICK_ETERNITY;
|
ob->wex = TICK_ETERNITY;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* (re)start writing and update timeout. Note: we don't recompute the timeout
|
/* (re)start writing and update timeout. Note: we don't recompute the timeout
|
||||||
* everytime we get here, otherwise it would risk never to expire. We only
|
* everytime we get here, otherwise it would risk never to expire. We only
|
||||||
|
Loading…
Reference in New Issue
Block a user