]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] add the end of line pointer in each HTTP header
authorWilly Tarreau <w@1wt.eu>
Sat, 13 Jan 2007 22:07:22 +0000 (23:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 13 Jan 2007 22:07:22 +0000 (23:07 +0100)
include/types/session.h
src/client.c

index a9f1bbb3f1da10805709ec33d61bc4e4c4cf4598..1302944576ec01578cb88b0aca2fde813d250d50 100644 (file)
@@ -118,10 +118,24 @@ typedef enum {
 
 /* This is an HTTP message, as described in RFC2616. It can be either a request
  * message or a response message.
+ *
+ * The values there are a little bit obscure, because their meaning can change
+ * during the parsing :
+ *
+ *  - sor (Start of Request) : relative offset in the buffer of first byte of
+ *                             the request being processed or parsed. Reset to
+ *                             zero during accept().
+ *  - eoh (End of Headers)   : relative offset in the buffer of first byte that
+ *                             is not part of a completely processed header.
+ *                             During parsing, it points to last header seen
+ *                             for states after START.
+ *  - eol (End of Line)      : relative offset in the buffer of the first byte
+ *                             which marks the end of the line (LF or CRLF).
  */
 struct http_msg {
        int hdr_state;                  /* where we are in the current header parsing */
        int sor, eoh;                   /* Start Of Request and End Of Headers, relative to buffer */
+       int eol;                        /* end of line */
        char **cap;                     /* array of captured request headers (may be NULL) */
 };
 
index a28273238c776f1165d85deb5f7bb7d9bf826652..7358d29628f6bcf50eb0eeb25de957b5b68730f2 100644 (file)
@@ -206,7 +206,7 @@ int event_accept(int fd) {
 
                if (p->mode == PR_MODE_HTTP) {
                        hreq->req.hdr_state = HTTP_PA_EMPTY; /* at the very beginning of the request */
-                       hreq->req.sor = hreq->req.eoh = 0; /* relative to the buffer */
+                       hreq->req.eol = hreq->req.sor = hreq->req.eoh = 0; /* relative to the buffer */
                        hreq->start.len = -1;
                        hreq->auth_hdr.len = -1;