diff options
author | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-08-08 02:07:24 +0000 |
---|---|---|
committer | zedshaw <zedshaw@19e92222-5c0b-0410-8929-a290d50e31e9> | 2006-08-08 02:07:24 +0000 |
commit | 6d89030158eee3c3a214be591815fdded7bcb2e3 (patch) | |
tree | 038820de515c5aafbbb1577720c943e4487bf7f5 /ext/http11/http11_parser.rl | |
parent | c9052ef40d96a2ecfa08882a4e5344520a8df72f (diff) | |
download | unicorn-6d89030158eee3c3a214be591815fdded7bcb2e3.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@308 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'ext/http11/http11_parser.rl')
-rw-r--r-- | ext/http11/http11_parser.rl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ext/http11/http11_parser.rl b/ext/http11/http11_parser.rl index e36d117..b16946d 100644 --- a/ext/http11/http11_parser.rl +++ b/ext/http11/http11_parser.rl @@ -19,6 +19,7 @@ action mark {MARK(mark, fpc); } + action start_field { MARK(field_start, fpc); } action write_field { parser->field_len = LEN(field_start, fpc); @@ -38,9 +39,11 @@ if(parser->request_uri != NULL) parser->request_uri(parser->data, PTR_TO(mark), LEN(mark, fpc)); } + + action start_query {MARK(query_start, fpc); } action query_string { if(parser->query_string != NULL) - parser->query_string(parser->data, PTR_TO(mark), LEN(mark, fpc)); + parser->query_string(parser->data, PTR_TO(query_start), LEN(query_start, fpc)); } action http_version { @@ -81,13 +84,13 @@ absolute_uri = (scheme ":" (uchar | reserved )*) >mark %request_uri; path = (pchar+ ( "/" pchar* )*) ; - query = ( uchar | reserved )* >mark %query_string ; + query = ( uchar | reserved )* >start_query %query_string ; param = ( pchar | "/" )* ; params = (param ( ";" param )*) ; - rel_path = (path? (";" params)?) %request_uri ("?" query)? ; - absolute_path = ("/"+ rel_path) >mark ; + rel_path = (path? (";" params)?) ("?" query)?; + absolute_path = ("/"+ rel_path); - Request_URI = ("*" >mark %request_uri | absolute_uri | absolute_path) ; + Request_URI = ("*" %request_uri | absolute_uri | absolute_path) >mark %request_uri; Method = (upper | digit | safe){1,20} >mark %request_method; http_number = (digit+ "." digit+) ; |