Quite honestly, I cannot say this:
is the kind of C I find very easy to read. On the other hand it's much more concise than the Java way where you basically have to define an interface and a class implementing this interface (hello java.lang.Comparable) just to provide a basic function.typedef char *(*ngx_conf_handler_pt)(ngx_conf_t *cf, ngx_command_t *dummy, void *conf);
So, just a warning: the C in nginx is not for the faint of heart. And given there is practically no comment to be found in the code, you should really consider getting back to your C courses if, like me, you haven't practiced in a few years.
So, I was mentioning handlers as they are pretty much everywhere. In particular, they are the foundation on which all modules are built. For a good idea of what kind of behavior you can change by implementing a module, you should read Valery's post on HTTP request processing phases.
Now, you might notice agentzh comment on NGX_AGAIN/NGX_DONE interpretation. Even Valery was not completely up to date with this. Now, what is really funny, is agentzh post: why nginx does not have an API reference. Even the core developers consider their baby good enough to commit to an API. I guess that's why it's still version 0.X.
Now, the scary part: more than 20M domains are running this...
No comments:
Post a Comment