Welcome! Log In Create A New Profile


doubt with proxy busy buffer

September 01, 2011 03:30AM

I write a module for file download, but sometimes it will alert
"the http output chain is empty while sending to client".
And I check the code, it seems that if proxy busy buffer run out,
write_filter will always return ngx error.

Is that right?

In function: ngx_event_pipe_write_to_downstream(ngx_event_pipe_t *p)

line 540:

out = NULL;

if (bsize >= (size_t) p->busy_size) {
flush = 1;
goto flush;

//If busy size is larger than that value in ngix.conf,
//out chain will be NULL and goto fulsh
//and call output_filter with NULL out chain.

line 617:

rc = p->output_filter(p->output_ctx, out);

//So get into ngx_http_write_filter(ngx_http_request_t *r, ngx_chain_t *in),
//print the alert log and return error.

line: 186

if (size == 0 && !(c->buffered & NGX_LOWLEVEL_BUFFERED)) {
if (last) {
r->out = NULL;
c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;

return NGX_OK;

if (flush) { // flush will never be true, because of NULL in chain
do {
r->out = r->out->next;
} while (r->out);

c->buffered &= ~NGX_HTTP_WRITE_BUFFERED;

return NGX_OK;

ngx_log_error(NGX_LOG_ALERT, c->log, 0,
"the http output chain is empty");


return NGX_ERROR;

Best Regard.
Subject Author Posted

doubt with proxy busy buffer

bigplum September 01, 2011 03:30AM

Re: doubt with proxy busy buffer

Maxim Dounin September 01, 2011 04:02AM

Re: doubt with proxy busy buffer

bigplum September 01, 2011 04:17AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 84
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready