diff options
Diffstat (limited to 'http_parser.rl')
-rw-r--r-- | http_parser.rl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/http_parser.rl b/http_parser.rl index 300b571..ae4217a 100644 --- a/http_parser.rl +++ b/http_parser.rl @@ -48,12 +48,16 @@ static char *skip_header(struct mog_http *http, char *buf, const char *pe) DELETE = "DELETE "> { http->_p.http_method = MOG_HTTP_METHOD_DELETE; }; MKCOL = "MKCOL "> { http->_p.http_method = MOG_HTTP_METHOD_MKCOL; }; + mog_fs_path = (mog_path) > { http->_p.path_tip = to_u8(fpc - buf); } + # TODO: maybe folks use query string/fragments for logging... + (" HTTP/1.") > { http->_p.path_end = to_u8(fpc - buf); }; + + usage_path = ('/' devid "usage HTTP/1.") @ { http->_p.usage_txt = 1; }; + # no HTTP/0.9 for now, sorry (not :P) req_line = (HEAD|GET|PUT|DELETE|MKCOL) ("http://" [^/]+)? - '/'*(mog_path) > { http->_p.path_tip = to_u8(fpc - buf); } - # TODO: maybe folks use query string/fragments for logging... - (" HTTP/1.") > { http->_p.path_end = to_u8(fpc - buf); } + '/'*(usage_path | mog_fs_path) ('0'|'1'> { http->_p.persistent = 1; }) '\r'LF; content_length = "Content-Length:"i sep |