-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
provide an error_code
member
#5
Comments
you can see where it failed by looking at the result of http_parser_execute() |
wtf, that was fast. Doesn't |
yes, but it exits immediately if there was an error. so if http_parser_execute() < sizeof(buf) then there was an error (or an Upgrade). You can use this to point out where the error was - which is perhaps more useful than an error code. |
hrm, I'd like to use the return values for indicating the reason why I made http-parser exit; for example after I got the request URL and figured out I want to answer with HTTP 404, it would be comfortable to simply return If I manually break parsing, I've got a reason to and I most probably want to communicate that reason back to the code that called So please add this feature. :-) |
You can communicate your state (or what action to take) to the code calling |
closing. |
I can end parsing a message by returning some non-
0
value. So if the parsing failed, I would like to see why it failed, hence, look at the return (error) code.Please provide something like a
error_code
member in thehttp_parser
struct.The text was updated successfully, but these errors were encountered: