[nginx] Stream: avoid infinite loop in case of socket read error.

Vladimir Homutov vl at nginx.com
Wed Jan 11 18:18:14 UTC 2017


details:   http://hg.nginx.org/nginx/rev/ee3645078759
branches:  
changeset: 6868:ee3645078759
user:      Vladimir Homutov <vl at nginx.com>
date:      Wed Jan 11 12:01:56 2017 +0300
description:
Stream: avoid infinite loop in case of socket read error.

diffstat:

 src/stream/ngx_stream_proxy_module.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (15 lines):

diff -r 8c4d07ef08f5 -r ee3645078759 src/stream/ngx_stream_proxy_module.c
--- a/src/stream/ngx_stream_proxy_module.c	Tue Jan 10 17:13:06 2017 +0300
+++ b/src/stream/ngx_stream_proxy_module.c	Wed Jan 11 12:01:56 2017 +0300
@@ -1534,8 +1534,9 @@ ngx_stream_proxy_process(ngx_stream_sess
 
         size = b->end - b->last;
 
-        if (size && src->read->ready && !src->read->delayed) {
-
+        if (size && src->read->ready && !src->read->delayed
+            && !src->read->error)
+        {
             if (limit_rate) {
                 limit = (off_t) limit_rate * (ngx_time() - u->start_sec + 1)
                         - *received;


More information about the nginx-devel mailing list