fdintino/nginx-upload-module

NGX_AGAIN Handling

rambabuwhy opened this issue · 2 comments

HI
I am facing an issue with NGX_AGAIN.
ngx upload module is returning NGX_AGAIN while uploading a file. when nginx calls again upload module but upload module returns NGX_OK if requestbody exist
if( r->requestbody) return NGX_OK and its continue in a loop.

any solution to this?

    if (!c->read->ready) {
        clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
        ngx_add_timer(c->read, clcf->client_body_timeout);

        if (ngx_handle_read_event(c->read, 0) != NGX_OK) {
            return NGX_HTTP_INTERNAL_SERVER_ERROR;
        }

        return NGX_AGAIN;
    }

Thanks
Ram

I don't understand what the issue is here... In the code you cited it is not a bug for NGX_AGAIN to be returned there. If the socket is not ready for reading then it returns NGX_AGAIN. Then, whenever the connection does start receiving data it will call the function again. If c->read->ready is always false, that suggests that the issue lies somewhere else, either with the client, the server configuration, or with another nginx module.

Hi, it resolved after increasing client body buffer size.
Thanks