diff options
Diffstat (limited to 'ext/unicorn_http')
-rw-r--r-- | ext/unicorn_http/unicorn_http.rl | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/unicorn_http/unicorn_http.rl b/ext/unicorn_http/unicorn_http.rl index f9dc158..9b33e31 100644 --- a/ext/unicorn_http/unicorn_http.rl +++ b/ext/unicorn_http/unicorn_http.rl @@ -637,8 +637,8 @@ static VALUE HttpParser_parse(VALUE self) struct http_parser *hp = data_get(self); VALUE data = hp->buf; - if (hp->flags == UH_FL_TO_CLEAR) { - hp->flags = 0; + if (HP_FL_TEST(hp, TO_CLEAR)) { + http_parser_init(hp); rb_funcall(hp->env, id_clear, 0); } @@ -736,8 +736,7 @@ static VALUE HttpParser_next(VALUE self) struct http_parser *hp = data_get(self); if ((HP_FL_ALL(hp, KEEPALIVE)) && (hp->nr_requests-- != 0)) { - http_parser_init(hp); - hp->flags = UH_FL_TO_CLEAR; + HP_FL_SET(hp, TO_CLEAR); return Qtrue; } return Qfalse; |