]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[STATS] frontend requests were not accounted for failed requests
authorWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 22:02:38 +0000 (23:02 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 4 Mar 2010 22:02:38 +0000 (23:02 +0100)
But failed requests were accounted for, resulting in more failures
than requests.

src/proto_http.c

index 3db8ac4a782e0923f6a9e793631b1b7301b25639..0131700e3b7824f8d2cf51d58b11ed76af8a4794 100644 (file)
@@ -2429,8 +2429,10 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
                /*
                 * First, let's catch bad requests.
                 */
-               if (unlikely(msg->msg_state == HTTP_MSG_ERROR))
+               if (unlikely(msg->msg_state == HTTP_MSG_ERROR)) {
+                       proxy_inc_fe_req_ctr(s->fe);
                        goto return_bad_req;
+               }
 
                /* 1: Since we are in header mode, if there's no space
                 *    left for headers, we won't be able to free more
@@ -2441,6 +2443,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
                        /* FIXME: check if URI is set and return Status
                         * 414 Request URI too long instead.
                         */
+                       proxy_inc_fe_req_ctr(s->fe);
                        goto return_bad_req;
                }
 
@@ -2458,6 +2461,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
                        msg->msg_state = HTTP_MSG_ERROR;
                        req->analysers = 0;
 
+                       proxy_inc_fe_req_ctr(s->fe);
                        s->fe->counters.failed_req++;
                        if (s->listener->counters)
                                s->listener->counters->failed_req++;
@@ -2483,6 +2487,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
                        msg->msg_state = HTTP_MSG_ERROR;
                        req->analysers = 0;
 
+                       proxy_inc_fe_req_ctr(s->fe);
                        s->fe->counters.failed_req++;
                        if (s->listener->counters)
                                s->listener->counters->failed_req++;
@@ -2507,6 +2512,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
                        msg->msg_state = HTTP_MSG_ERROR;
                        req->analysers = 0;
 
+                       proxy_inc_fe_req_ctr(s->fe);
                        s->fe->counters.failed_req++;
                        if (s->listener->counters)
                                s->listener->counters->failed_req++;