]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: compression: does not forward trailers
authorWilliam Lallemand <wlallemand@exceliance.fr>
Thu, 22 Nov 2012 16:55:14 +0000 (17:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2012 10:12:33 +0000 (11:12 +0100)
The commit bf3ae617 introduced a regression about the forward of the
trailers in compression mode.

src/compression.c
src/proto_http.c

index 3622d4091cb1afce9cf1543e2c9407f4df074e29..fd5f7901efc412928ad7cd0268e49b0411d342eb 100644 (file)
@@ -298,10 +298,6 @@ int http_compression_buffer_end(struct session *s, struct buffer **in, struct bu
        /* forward the new chunk without remaining data */
        b_adv(ob, to_forward);
 
-       /* if there are data between p and next, there are trailers, must forward them */
-       b_adv(ob, msg->next);
-       msg->next = 0;
-
        return to_forward;
 }
 
index b82d45319b0a78fb0bab6a75d2a15502b29debb3..aea1ec22f02e2c3dea63bd3b6a92445142d3c7b8 100644 (file)
@@ -5691,7 +5691,12 @@ int http_response_forward_body(struct session *s, struct channel *res, int an_bi
                                        http_capture_bad_message(&s->be->invalid_rep, s, msg, HTTP_MSG_TRAILERS, s->fe);
                                goto return_bad_res;
                        }
-                                       /* we're in HTTP_MSG_DONE now */
+                       if (s->comp_algo != NULL) {
+                               /* forwarding trailers */
+                               channel_forward(res, msg->next);
+                               msg->next = 0;
+                       }
+                       /* we're in HTTP_MSG_DONE now */
                }
                else {
                        int old_state = msg->msg_state;