[MEDIUM] make it possible to change the buffer size in the configuration
The new tune.bufsize and tune.maxrewrite global directives allow one to
change the buffer size and the maxrewrite size. Right now, setting bufsize
too low will block stats sockets which will not be able to write at all.
An error checking must be added to buffer_write_chunk() so that if it
cannot write its message to an empty buffer, it causes the caller to abort.
diff --git a/src/proto_uxst.c b/src/proto_uxst.c
index 0cd6a35..c811f64 100644
--- a/src/proto_uxst.c
+++ b/src/proto_uxst.c
@@ -482,7 +482,7 @@
if ((s->req = pool_alloc2(pool2_buffer)) == NULL)
goto out_free_task;
- s->req->size = BUFSIZE;
+ s->req->size = global.tune.bufsize;
buffer_init(s->req);
s->req->prod = &s->si[0];
s->req->cons = &s->si[1];
@@ -499,7 +499,7 @@
if ((s->rep = pool_alloc2(pool2_buffer)) == NULL)
goto out_free_req;
- s->rep->size = BUFSIZE;
+ s->rep->size = global.tune.bufsize;
buffer_init(s->rep);
s->rep->prod = &s->si[1];