MEDIUM: http: add a pointer to the buffer in http_msg
ACLs and patterns only rely on a struct http_msg and don't know the pointer
to the actual data. struct http_msg will soon only hold relative references
so that's not possible. We need http_msg to hold a reference to the struct
buffer before having relative pointers everywhere.
It is likely that doing so will also result in opportunities to simplify
a number of functions arguments. The following functions are already
candidate :
http_buffer_heavy_realign
http_capture_bad_message
http_change_connection_header
http_forward_trailers
http_header_add_tail
http_header_add_tail2
http_msg_analyzer
http_parse_chunk_size
http_parse_connection_header
http_remove_header2
http_send_name_header
http_skip_chunk_crlf
http_upgrade_v09_to_v10
diff --git a/include/types/proto_http.h b/include/types/proto_http.h
index 5df00bd..2c8b876 100644
--- a/include/types/proto_http.h
+++ b/include/types/proto_http.h
@@ -307,6 +307,7 @@
struct http_msg {
unsigned int msg_state; /* where we are in the current message parsing */
unsigned int flags; /* flags describing the message (HTTP version, ...) */
+ struct buffer *buf; /* pointer to the buffer which holds the message */
unsigned int next; /* pointer to next byte to parse, relative to buf->p */
unsigned int sov; /* current header: start of value */
unsigned int eoh; /* End Of Headers, relative to buffer */