about summary refs log tree commit homepage
path: root/ext/unicorn/http11/http11_parser.rl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-04-21 11:14:51 -0700
committerEric Wong <normalperson@yhbt.net>2009-04-21 11:16:35 -0700
commitb031b9d2cb1bd0434ce2891ce20a65a5b5b29796 (patch)
tree1c7f97ba44ae08e751bff4ba59f0c8f308ebe22d /ext/unicorn/http11/http11_parser.rl
parentb57718fb7ed6f813f41b655ecbab1f6edd64ded0 (diff)
downloadunicorn-b031b9d2cb1bd0434ce2891ce20a65a5b5b29796.tar.gz
We now parse the scheme, host and port from Absolute URIs and
ignore them if the equivalents are specified in the other
headers.
Diffstat (limited to 'ext/unicorn/http11/http11_parser.rl')
-rw-r--r--ext/unicorn/http11/http11_parser.rl4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/unicorn/http11/http11_parser.rl b/ext/unicorn/http11/http11_parser.rl
index 991ba58..9894276 100644
--- a/ext/unicorn/http11/http11_parser.rl
+++ b/ext/unicorn/http11/http11_parser.rl
@@ -10,6 +10,8 @@
 static void http_field(void *data, const char *field,
                        size_t flen, const char *value, size_t vlen);
 static void request_method(void *data, const char *at, size_t length);
+static void scheme(void *data, const char *at, size_t length);
+static void host(void *data, const char *at, size_t length);
 static void request_uri(void *data, const char *at, size_t length);
 static void fragment(void *data, const char *at, size_t length);
 static void request_path(void *data, const char *at, size_t length);
@@ -75,6 +77,8 @@ static void downcase_char(char *c)
   action request_method {
     request_method(parser->data, PTR_TO(mark), LEN(mark, fpc));
   }
+  action scheme { scheme(parser->data, PTR_TO(mark), LEN(mark, fpc)); }
+  action host { host(parser->data, PTR_TO(mark), LEN(mark, fpc)); }
   action request_uri {
     request_uri(parser->data, PTR_TO(mark), LEN(mark, fpc));
   }