Welcome! Log In Create A New Profile

Advanced

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

November 07, 2011 11:31PM
Here are my code:
static void v8_embed_handler ( ngx_http_request_t * r )
{
...// generating out chain.
rc = ngx_http_output_filter ( r , out );
while( rc == NGX_AGAIN ) {
if( out->next == NULL )
break;
rc = ngx_http_output_filter ( r , out->next );
out = out->next;
}
ngx_http_finalize_request ( r , rc );
}
static ngx_int_t ngx_http_v8_handler_request(ngx_http_request_t *r)
{
ngx_int_t rc = NGX_DONE ;
rc = ngx_http_read_client_request_body ( r , v8_embed_handler ) ; // call the v8_embed_handler handler to process the post data
if ( rc >= NGX_HTTP_SPECIAL_RESPONSE )
return rc;
return NGX_DONE;
}

Then I changed the code as :
static void v8_embed_handler ( ngx_http_request_t * r )
{
...// generating out chain.
ngx_http_finalize_request ( r , ngx_http_output_filter ( r , out ) );
}
However, it doesn't change the test result. If the response is larger than 64Kb, the problem is still there.
I'm using curl to test it. It firstly output 64k response and it says "curl: (18) transfer closed with 19013 bytes remaining to read". Then it output a little part of the remaining response. I don't really understand why.
Subject Author Posted

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

sayeo87 June 29, 2009 06:33PM

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

Maxim Dounin June 29, 2009 07:21PM

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

Mike Smith June 29, 2009 07:42PM

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

sayeo87 June 30, 2009 01:29PM

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

Valery Kholodkov July 01, 2009 11:52AM

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

CarlWang November 07, 2011 11:36AM

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

Maxim Dounin November 07, 2011 12:50PM

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

CarlWang November 07, 2011 11:31PM

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

agentzh November 08, 2011 01:58AM

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

CarlWang November 08, 2011 10:23AM

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

CarlWang November 08, 2011 11:44AM

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

agentzh November 08, 2011 08:30PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 190
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready