]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[CLEANUP] buffers: remove remains of wrong obsolete length check
authorWilly Tarreau <w@1wt.eu>
Fri, 15 Jan 2010 22:38:27 +0000 (23:38 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 Jan 2010 22:16:39 +0000 (23:16 +0100)
A check was performed in buffer_replace2() to compare buffer
length with its read pointer. This has been wrong for a long
time, though it only has an impact when dealing with keep-alive
requests/responses. In theory this should be backported but
the check has no impact without keep-alive.
(cherry picked from commit 43a7e6620b79e0e771dbaf2a60b57c96d9ba60e5)

src/buffers.c

index 0de88fcfe905d6777f21a6ab29448a315d7f9485..0910320f6fcf87182c632ffcde4a0b92872ffaf1 100644 (file)
@@ -148,12 +148,6 @@ int buffer_replace2(struct buffer *b, char *pos, char *end, const char *str, int
        if (delta + b->r >= b->data + BUFSIZE)
                return 0;  /* no space left */
 
-       if (b->data + b->l < end) {
-               /* The data has been stolen, we could have crashed.
-                * Maybe we should abort() ? */
-               return 0;
-       }
-
        /* first, protect the end of the buffer */
        memmove(end + delta, end, b->r - end);