BUG/MEDIUM: compression: does not forward trailers
The commit bf3ae617 introduced a regression about the forward of the
trailers in compression mode.
diff --git a/src/compression.c b/src/compression.c
index 3622d40..fd5f790 100644
--- a/src/compression.c
+++ b/src/compression.c
@@ -298,10 +298,6 @@
/* 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;
}
diff --git a/src/proto_http.c b/src/proto_http.c
index b82d453..aea1ec2 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -5691,7 +5691,12 @@
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;