]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: peers: the buffer size is global.tune.bufsize, not trash.size
authorWilly Tarreau <w@1wt.eu>
Mon, 24 Nov 2014 09:47:35 +0000 (10:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 24 Nov 2014 14:40:57 +0000 (15:40 +0100)
Currently this is harmless since trash.size is copied from
global.tune.bufsize, but this may soon change when buffers become
more dynamic.

At least for consistency it should be backported to 1.5.

src/peers.c

index b1022ab43e4707b01bd23349652da9bda0fdbefb..b196d881eddd66d7db2a3bb0cb45fd8eb38e3eec 100644 (file)
@@ -1240,7 +1240,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
        if ((s->req->buf = pool_alloc2(pool2_buffer)) == NULL)
                goto out_fail_req_buf; /* no memory */
 
-       s->req->buf->size = trash.size;
+       s->req->buf->size = global.tune.bufsize;
        channel_init(s->req);
        s->req->prod = &s->si[0];
        s->req->cons = &s->si[1];
@@ -1266,7 +1266,7 @@ static struct session *peer_session_create(struct peer *peer, struct peer_sessio
        if ((s->rep->buf = pool_alloc2(pool2_buffer)) == NULL)
                goto out_fail_rep_buf; /* no memory */
 
-       s->rep->buf->size = trash.size;
+       s->rep->buf->size = global.tune.bufsize;
        channel_init(s->rep);
        s->rep->prod = &s->si[1];
        s->rep->cons = &s->si[0];