]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: http: remove buffer arg in http_msg_analyzer
authorWilly Tarreau <w@1wt.eu>
Fri, 9 Mar 2012 12:50:57 +0000 (13:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 10:28:13 +0000 (12:28 +0200)
The buffer pointer is now taken from the http_msg.

src/proto_http.c

index 4521cce46bed8a395e70a168ee5c2f55d36f1c9f..dccf58c7d6a5e5c5f84cc6245721703471c02946 100644 (file)
@@ -1274,10 +1274,11 @@ get_http_auth(struct session *s)
  * the first state, so that none of the msg pointers has to be initialized
  * prior to the first call.
  */
-void http_msg_analyzer(struct buffer *buf, struct http_msg *msg, struct hdr_idx *idx)
+void http_msg_analyzer(struct http_msg *msg, struct hdr_idx *idx)
 {
        unsigned int state;       /* updated only when leaving the FSM */
        register char *ptr, *end; /* request pointers, to avoid dereferences */
+       struct buffer *buf = msg->buf;
 
        state = msg->msg_state;
        ptr = buffer_wrap_add(buf, buf->p + msg->next);
@@ -2084,7 +2085,7 @@ int http_wait_for_request(struct session *s, struct buffer *req, int an_bit)
                }
 
                if (likely(msg->next < req->i)) /* some unparsed data are available */
-                       http_msg_analyzer(req, msg, &txn->hdr_idx);
+                       http_msg_analyzer(msg, &txn->hdr_idx);
        }
 
        /* 1: we might have to print this header in debug mode */
@@ -4472,7 +4473,7 @@ int http_wait_for_response(struct session *s, struct buffer *rep, int an_bit)
                }
 
                if (likely(msg->next < rep->i))
-                       http_msg_analyzer(rep, msg, &txn->hdr_idx);
+                       http_msg_analyzer(msg, &txn->hdr_idx);
        }
 
        /* 1: we might have to print this header in debug mode */
@@ -8097,7 +8098,7 @@ acl_fetch_proto_http(struct proxy *px, struct session *s, void *l7, int dir,
 
        /* Try to decode HTTP request */
        if (likely(msg->next < req->i))
-               http_msg_analyzer(req, msg, &txn->hdr_idx);
+               http_msg_analyzer(msg, &txn->hdr_idx);
 
        if (unlikely(msg->msg_state < HTTP_MSG_BODY)) {
                if ((msg->msg_state == HTTP_MSG_ERROR) || (req->flags & BF_FULL)) {