about summary refs log tree commit homepage
path: root/ext/unicorn/http11/http11_parser.rl
diff options
context:
space:
mode:
Diffstat (limited to 'ext/unicorn/http11/http11_parser.rl')
-rw-r--r--ext/unicorn/http11/http11_parser.rl14
1 files changed, 3 insertions, 11 deletions
diff --git a/ext/unicorn/http11/http11_parser.rl b/ext/unicorn/http11/http11_parser.rl
index 5f4422f..991ba58 100644
--- a/ext/unicorn/http11/http11_parser.rl
+++ b/ext/unicorn/http11/http11_parser.rl
@@ -107,21 +107,15 @@ static void downcase_char(char *c)
 /** Data **/
 %% write data;
 
-static int http_parser_init(http_parser *parser) {
+static void http_parser_init(http_parser *parser) {
   int cs = 0;
+  memset(parser, 0, sizeof(*parser));
   %% write init;
   parser->cs = cs;
-  parser->body_start = 0;
-  parser->mark = 0;
-  parser->nread = 0;
-  parser->field_len = 0;
-  parser->field_start = 0;
-
-  return(1);
 }
 
 /** exec **/
-static size_t http_parser_execute(
+static void http_parser_execute(
   http_parser *parser, const char *buffer, size_t len)
 {
   const char *p, *pe;
@@ -148,8 +142,6 @@ static size_t http_parser_execute(
   assert(parser->mark < len && "mark is after buffer end");
   assert(parser->field_len <= len && "field has length longer than whole buffer");
   assert(parser->field_start < len && "field starts after buffer end");
-
-  return(parser->nread);
 }
 
 static int http_parser_has_error(http_parser *parser) {