From a051533bf7ffbc83f80a45280d4a43c859e9ce65 Mon Sep 17 00:00:00 2001 From: Christos Trochalakis Date: Wed, 11 Apr 2018 08:18:03 +0300 Subject: [PATCH] New upstream version 1.13.12 --- CHANGES | 6 ++++++ CHANGES.ru | 6 ++++++ src/core/nginx.h | 4 ++-- src/http/ngx_http_upstream.c | 18 ++++++++++++------ 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 47501aa..fa22ad5 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ +Changes with nginx 1.13.12 10 Apr 2018 + + *) Bugfix: connections with gRPC backends might be closed unexpectedly + when returning a large response. + + Changes with nginx 1.13.11 03 Apr 2018 *) Feature: the "proxy_protocol" parameter of the "listen" directive now diff --git a/CHANGES.ru b/CHANGES.ru index 70d96c9..79746e3 100644 --- a/CHANGES.ru +++ b/CHANGES.ru @@ -1,4 +1,10 @@ +Изменения в nginx 1.13.12 10.04.2018 + + *) Исправление: при возврате большого ответа соединения с gRPC-бэкендами + могли неожиданно закрываться. + + Изменения в nginx 1.13.11 03.04.2018 *) Добавление: параметр proxy_protocol директивы listen теперь diff --git a/src/core/nginx.h b/src/core/nginx.h index 0267ea9..0065464 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -9,8 +9,8 @@ #define _NGINX_H_INCLUDED_ -#define nginx_version 1013011 -#define NGINX_VERSION "1.13.11" +#define nginx_version 1013012 +#define NGINX_VERSION "1.13.12" #define NGINX_VER "nginx/" NGINX_VERSION #ifdef NGX_BUILD diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index a415f58..8fc3042 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -2013,8 +2013,6 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u, /* rc == NGX_OK */ - u->request_body_sent = 1; - if (c->write->timer_set) { ngx_del_timer(c->write); } @@ -2041,11 +2039,19 @@ ngx_http_upstream_send_request(ngx_http_request_t *r, ngx_http_upstream_t *u, return; } - ngx_add_timer(c->read, u->conf->read_timeout); + if (!u->request_body_sent) { + u->request_body_sent = 1; - if (c->read->ready) { - ngx_http_upstream_process_header(r, u); - return; + if (u->header_sent) { + return; + } + + ngx_add_timer(c->read, u->conf->read_timeout); + + if (c->read->ready) { + ngx_http_upstream_process_header(r, u); + return; + } } }