Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't set last_buf=1 (duplicated last chunk issue).

Because ngx_http_upstream_finalize_request sends NGX_HTTP_LAST,
having last_buf=1 in our module meant that last two chains always
had last_buf=1, which resulted in duplicated last chunk sent for
HTTP/1.1 requests. This pretty much killed keep-alived requests.

Reported by Silly Sad, diagnosed by Maxim Dounin.

Same issue was independently diagnosed and fixed in ngx_drizzle
by Yichun Zhang (agentzh) few days ago.
  • Loading branch information...
commit 74e74acb8379f4e62334e4b0bc277663b8eff918 1 parent 9a7ee95
Piotr Sikora PiotrSikora authored
Showing with 0 additions and 4 deletions.
  1. +0 −4 src/ngx_postgres_output.c
4 src/ngx_postgres_output.c
View
@@ -124,7 +124,6 @@ ngx_postgres_output_value(ngx_http_request_t *r, PGresult *res,
cl->buf = b;
b->memory = 1;
b->tag = r->upstream->output.tag;
- b->last_buf = 1;
b->last = ngx_copy(b->last, PQgetvalue(res, pgv->row, col), size);
@@ -209,7 +208,6 @@ ngx_postgres_output_row(ngx_http_request_t *r, PGresult *res,
cl->buf = b;
b->memory = 1;
b->tag = r->upstream->output.tag;
- b->last_buf = 1;
/* fill data */
for (col = 0; col < col_count - 1; col++) {
@@ -521,7 +519,6 @@ ngx_postgres_render_rds_row(ngx_http_request_t *r, ngx_pool_t *pool,
}
if (last_row) {
- b->last_buf = 1;
*b->last++ = (uint8_t) 0; /* row terminator */
}
@@ -557,7 +554,6 @@ ngx_postgres_render_rds_row_terminator(ngx_http_request_t *r, ngx_pool_t *pool)
cl->buf = b;
b->memory = 1;
b->tag = r->upstream->output.tag;
- b->last_buf = 1;
/* fill data */
*b->last++ = (uint8_t) 0; /* row terminator */
Please sign in to comment.
Something went wrong with that request. Please try again.