ngx_http_process_header_line function in source code

alayim nginx-forum at nginx.us
Sat Jun 21 14:35:20 UTC 2014


I see your point.
By the way, is there a more appropriate forum or email list I should use for
these kinds of questions?
I'm a fairly fresh computer science student who just started working in the
industry, and all I'm ever allowed to work on, is Java and C#,
so I decided to do some C hacking on a hobby basis...and chose you poor
souls as my subject.
My plan is basically to just stare at the code untill it makes a bit of
sense, and ask questions if I see something I think might be an error of
some sort, or if I don't understand it, and eventually, maybe I'm even able
to contribute something worthwhile.

So, I'm wondering, if there is any more appropriate place where I can ask
questions about things I find in the code-base.

For instance, right now I'm staring at ngx_http_parse.c
It seems that the switch (p - m)  block at line ~164 is lacking a default
label.
So to my naive eyes, it seems it's possible to run
ngx_http_parse_request_line() on a request with a method of less than 3
characters or more than 9, and get a ok return value, where the http-method
is still in its unmodified initial value of NGX_HTTP_UNKNOWN, which doesen't
seem to be handled elsewhere in the code(I tried grepping for it).

Should a default value return NGX_HTTP_PARSE_INVALID_METHOD? Did I actually
spot something? Or is it left this way by design?

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,250869,251092#msg-251092



More information about the nginx mailing list