How to handle NGX_AGAIN returned by ngx_http_read_client_request_body() within handler module?

CarlWang nginx-forum at nginx.us
Mon Nov 7 16:36:10 UTC 2011


I have a similar problem here.
My handler module in Nginx is supposed to intercept POST requests,
analyse it and send response( the response body maybe larger than 64k).
Of course, I used ngx_http_read_client_request_body to register my
request_body_handler.
The request_body_handler does some computing and calls
ngx_http_output_filter(r,out) to send the response.
Here is the problem. If this response is less than 64k, it works fine.
But if this response is larger than 64k, the ngx_http_output_filter will
return NGX_AGAIN. However, since it's in the request_body_handler
function and it has nothing to return. I can't figure out how to handle
this NGX_AGAIN.

Can anyone help me out? Thanks a lot.

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



More information about the nginx mailing list