[MEDIUM] remove stream_sock_update_data()
Two new functions are used instead : buffer_check_{shutr,shutw}.
It is indeed more adequate to check for new closures only when the
buffer reports them.
Several remaining unclosed connections were detected after a test,
even before this patch, so a bug remains. To reproduce, try the
following during 30 seconds :
inject30l4 -n 20000 -l -t 1000 -P 10 -o 4 -u 100 -s 100 -G 127.0.0.1:8000/
diff --git a/src/proto_http.c b/src/proto_http.c
index df905e2..f73964a 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -1136,7 +1136,12 @@
if (s->rep->cons->state != SI_ST_CLO) {
if (((rqf_cli ^ s->req->flags) & BF_MASK_INTERFACE_I) ||
((rpf_cli ^ s->rep->flags) & BF_MASK_INTERFACE_O)) {
- stream_sock_data_update(s->rep->cons->fd);
+
+ if (!(s->rep->flags & BF_SHUTW))
+ buffer_check_shutw(s->rep);
+ if (!(s->req->flags & BF_SHUTR))
+ buffer_check_shutr(s->req);
+
rqf_cli = s->req->flags;
rpf_cli = s->rep->flags;
}
@@ -1175,7 +1180,10 @@
buffer_shutw_now(s->req);
}
- stream_sock_data_update(s->req->cons->fd);
+ if (!(s->req->flags & BF_SHUTW))
+ buffer_check_shutw(s->req);
+ if (!(s->rep->flags & BF_SHUTR))
+ buffer_check_shutr(s->rep);
/* When a server-side connection is released, we have to
* count it and check for pending connections on this server.