NGX_AGAIN and POST data

Brian Bruns brian.bruns at gmail.com
Mon Oct 6 05:59:01 MSD 2008


Hi all,

I'm writing a module for nginx and am hoping someone could enlighten me.

The module takes in some parameters via either GET or POST methods.
Everything works fine except when using Python's urllib which appears
to send the HTTP POST data as two TCP packets.

The short of it is that ngx_http_read_client_request_body() returns
NGX_AGAIN because c->read->ready is not set.  My module in turn passes
NGX_AGAIN back up to the calling routine.

The confusing part to me is the following lines from
src/http/ngx_http_core_module.c:

    if (r->content_handler) {
        r->write_event_handler = ngx_http_request_empty_handler;
        ngx_http_finalize_request(r, r->content_handler(r));
        return NGX_OK;
    }

which appears to (according the debug stuff in the log) simply close
out the connection regardless of the return value from
content_handler().  Shouldn't my module be getting re-called when more
data is available from the connection or am I misunderstanding
something?

Thanks in advance,

Brian





More information about the nginx mailing list