Permalink
Browse files

Fix GH#12 - set num_headers every time a parse attempt is made

  • Loading branch information...
stash committed Sep 7, 2011
1 parent 197a76f commit 8b5814df0028522d1f8a11696dcca248d1489daa
Showing with 5 additions and 1 deletion.
  1. +5 −1 Feersum.xs
View
@@ -926,9 +926,13 @@ try_parse_http(struct feer_conn *c, size_t last_read)
struct feer_req *req = c->req;
if (likely(!req)) {
Newxz(req,1,struct feer_req);
- req->num_headers = MAX_HEADERS;
c->req = req;
}
+
+ // GH#12 - incremental parsing sets num_headers to 0 each time; force it
+ // back on every invocation
+ req->num_headers = MAX_HEADERS;
+
return phr_parse_request(SvPVX(c->rbuf), SvCUR(c->rbuf),
&req->method, &req->method_len,
&req->path, &req->path_len, &req->minor_version,

0 comments on commit 8b5814d

Please sign in to comment.