]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MEDIUM] http: add some SI_FL_NOLINGER around server errors
authorWilly Tarreau <w@1wt.eu>
Tue, 29 Dec 2009 13:56:36 +0000 (14:56 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 29 Dec 2009 13:56:36 +0000 (14:56 +0100)
When we catch an error from the server, speed up the connection
abort since we don't want to remain long with pending data in the
socket, and we want to be able to reuse our source port ASAP.

src/proto_http.c

index 3a5f14100a6d21d6598c1f9fa531457e3a50e215..791d52e3ff320678c84616404beee4495a741127 100644 (file)
@@ -3502,6 +3502,7 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit)
 
                        rep->analysers = 0;
                        txn->status = 502;
+                       rep->prod->flags |= SI_FL_NOLINGER;
                        stream_int_retnclose(rep->cons, error_message(s, HTTP_ERR_502));
 
                        if (!(s->flags & SN_ERR_MASK))
@@ -3530,6 +3531,7 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit)
 
                        rep->analysers = 0;
                        txn->status = 502;
+                       rep->prod->flags |= SI_FL_NOLINGER;
                        stream_int_retnclose(rep->cons, error_message(s, HTTP_ERR_502));
 
                        if (!(s->flags & SN_ERR_MASK))
@@ -3552,6 +3554,7 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit)
 
                        rep->analysers = 0;
                        txn->status = 504;
+                       rep->prod->flags |= SI_FL_NOLINGER;
                        stream_int_retnclose(rep->cons, error_message(s, HTTP_ERR_504));
 
                        if (!(s->flags & SN_ERR_MASK))
@@ -3574,6 +3577,7 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit)
 
                        rep->analysers = 0;
                        txn->status = 502;
+                       rep->prod->flags |= SI_FL_NOLINGER;
                        stream_int_retnclose(rep->cons, error_message(s, HTTP_ERR_502));
 
                        if (!(s->flags & SN_ERR_MASK))
@@ -3970,6 +3974,7 @@ int http_process_res_common(struct session *t, struct buffer *rep, int an_bit, s
                                return_srv_prx_502:
                                        rep->analysers = 0;
                                        txn->status = 502;
+                                       rep->prod->flags |= SI_FL_NOLINGER;
                                        stream_int_retnclose(rep->cons, error_message(t, HTTP_ERR_502));
                                        if (!(t->flags & SN_ERR_MASK))
                                                t->flags |= SN_ERR_PRXCOND;