nodejs / http-parser

http request/response parser for c
MIT License
6.35k stars 1.54k forks source link

Add an ability to disable body parsing #478

Open azaretsky opened 5 years ago

azaretsky commented 5 years ago

Currently the on_headers_complete callback can return 0 to proceed with the response body, 1 to skip the body, and 2 to skip the body and stop looking for further messages, and this decision on what to do with the body can only be made inside the on_headers_complete callback.

This PR adds an ability to alter the parser behaviour later after on_headers_complete pauses the parser and returns 0.

To be honest I'm not very fond of the preprocessor usage or the name http_parser_continue_after_on_headers_complete.