]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] debug: correctly report truncated messages
authorWilly Tarreau <w@1wt.eu>
Mon, 7 Jun 2010 12:06:08 +0000 (14:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 7 Jun 2010 20:43:55 +0000 (22:43 +0200)
By using msg->sol as the beginning of a message, wrong messages were
displayed in debug mode when they were truncated on the last line,
because msg->sol points to the beginning of the last line. Use
data+msg->som instead.

src/proto_http.c

index ad95e569b9823e12f2454646c0f70e816661c349..5471ab5c243ede259a0340df67e69bb9c8b40c0c 100644 (file)
@@ -2413,7 +2413,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
                     (msg->msg_state >= HTTP_MSG_BODY || msg->msg_state == HTTP_MSG_ERROR))) {
                char *eol, *sol;
 
-               sol = msg->sol;
+               sol = req->data + msg->som;
                eol = sol + msg->sl.rq.l;
                debug_hdr("clireq", s, sol, eol);
 
@@ -4337,7 +4337,7 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit)
                     (msg->msg_state >= HTTP_MSG_BODY || msg->msg_state == HTTP_MSG_ERROR))) {
                char *eol, *sol;
 
-               sol = msg->sol;
+               sol = rep->data + msg->som;
                eol = sol + msg->sl.st.l;
                debug_hdr("srvrep", s, sol, eol);