]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] http stats: large outputs sometimes got some parts chopped off
authorWilly Tarreau <w@1wt.eu>
Thu, 24 Sep 2009 20:22:18 +0000 (22:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Sep 2009 20:22:18 +0000 (22:22 +0200)
Due to a misplaced call to stream_int_retnclose(), the stats output
buffer was erased before each call to produce_content(), resulting
in missing pieces in the stats output if the connection was not
fast enough between haproxy and the client.

src/proto_http.c

index fd768874a728d482ac8af5a42108d6792e7ec716..c5209691bfec9c296e60e80166cca8a3ada6fe70 100644 (file)
@@ -3258,7 +3258,6 @@ void produce_content(struct session *s, struct buffer *rep)
        else if (s->data_source == DATA_SRC_STATS) {
                /* dump server statistics */
                int ret;
-               stream_int_retnclose(rep->cons, NULL);
                ret = stats_dump_http(s, rep, s->be->uri_auth);
                if (ret >= 0)
                        return;
@@ -4633,6 +4632,7 @@ int stats_check_uri_auth(struct session *t, struct proxy *backend)
        buffer_dont_connect(t->req);
        buffer_shutw_now(t->req);
        buffer_shutr_now(t->rep);
+       stream_int_retnclose(t->rep->cons, NULL);
        t->logs.tv_request = now;
        t->data_source = DATA_SRC_STATS;
        t->data_state  = DATA_ST_INIT;