I've been unable to elicit an http response from evhtp when the parser hits an error on invalid content length value and exits prematurely without consuming all input. I'm not sure if this indicates a bug or if I simply haven't found the correct way to achieve what I'd like.
Details
I've been unable to elicit an http response from evhtp when the parser hits an error on invalid content length value and exits prematurely without consuming all input. I'm not sure if this indicates a bug or if I simply haven't found the correct way to achieve what I'd like.
Steps or code to reproduce the problem.
$ examples/test_basic $ curl -H "Content-Length:x" http://127.0.0.1:8081/simple/ curl: (52) Empty reply from server
It looks like the parser exits early when str_to_uint64 fails (parser.c:1789):
and htp__connectionreadcb bails out:
I've tried working around this by hooking evhtp_connection_free via htp__hook_connectionfini:
but no dice. I see my log message but still get no http response.
Version
1.2.18