Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http_parser_settings' callback not called #66

Closed
coanor opened this issue Mar 22, 2013 · 2 comments
Closed

http_parser_settings' callback not called #66

coanor opened this issue Mar 22, 2013 · 2 comments

Comments

@coanor
Copy link

coanor commented Mar 22, 2013

I ported webdis code into a HTTP server that only serve as a server.

I have read most of webdis source code. I use cscope to find where http_parser_settings's callback calling, but following callbacks not been called:

  • on_url
  • on_query_string
  • on_message_complete
  • on_header_field
  • on_header_value

This confused me a lot. While a client object comes, I don't know whether it's request is complete, as I expect, while a client HTTP request complete, on_message_complete should be called.

Why set these callbacks that no code has really executed?

@nicolasff
Copy link
Owner

Hi,

These callbacks are called, from http-parser.c. The parser declares callbacks named on_something and calls them using the macro CALLBACK(something): https://github.com/nicolasff/webdis/blob/master/http-parser/http_parser.c#L59
Look for CALLBACK in http_parser.c and you'll find lots of them. This HTTP parsing library comes from Joyent.

cscope does not interpret preprocessor macros and therefore does not know what calls these functions.

Regards,

Nicolas

@coanor
Copy link
Author

coanor commented Mar 22, 2013

ohh, thanks a lot.

@coanor coanor closed this as completed Mar 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants