[MEDIUM] replace BUFSIZE with buf->size in computations
The first step towards dynamic buffer size consists in removing
all static definitions of the buffer size. Instead, we store a
buffer's size in itself. Right now they're all preinitialized
to BUFSIZE, but we will change that.
diff --git a/src/session.c b/src/session.c
index 33109d6..23c4409 100644
--- a/src/session.c
+++ b/src/session.c
@@ -320,7 +320,7 @@
struct buffer *rep = si->ib;
if (s->be->mode == PR_MODE_TCP) { /* let's allow immediate data connection in this case */
- buffer_set_rlim(rep, BUFSIZE); /* no rewrite needed */
+ buffer_set_rlim(rep, rep->size); /* no rewrite needed */
/* if the user wants to log as soon as possible, without counting
* bytes from the server, then this is the right moment. */
@@ -330,7 +330,7 @@
}
}
else {
- buffer_set_rlim(rep, BUFSIZE - MAXREWRITE); /* rewrite needed */
+ buffer_set_rlim(rep, req->size - MAXREWRITE); /* rewrite needed */
s->txn.rsp.msg_state = HTTP_MSG_RPBEFORE;
/* reset hdr_idx which was already initialized by the request.
* right now, the http parser does it.