aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_proxy_module.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2022-12-01 04:22:31 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2022-12-01 04:22:31 +0300
commit39892c6265bb36604bbcbd5e315ec3ee0e91c277 (patch)
treeb3acecb7ed1fe8aa8710a2c2b61655406c10b6e7 /src/stream/ngx_stream_proxy_module.c
parenta77cef0995fb29af6602dcdeb560755443cb2cca (diff)
downloadnginx-39892c6265bb36604bbcbd5e315ec3ee0e91c277.tar.gz
nginx-39892c6265bb36604bbcbd5e315ec3ee0e91c277.zip
SSL: fixed ngx_ssl_recv() to reset c->read->ready after errors.
With this change, behaviour of ngx_ssl_recv() now matches ngx_unix_recv(), which used to always reset c->read->ready to 0 when returning errors. This fixes an infinite loop in unbuffered SSL proxying if writing to the client is blocked and an SSL error happens (ticket #2418). With this change, the fix for a similar issue in the stream module (6868:ee3645078759), which used a different approach of explicitly testing c->read->error instead, is no longer needed and was reverted.
Diffstat (limited to 'src/stream/ngx_stream_proxy_module.c')
-rw-r--r--src/stream/ngx_stream_proxy_module.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c
index e13d72f3a..eb2097621 100644
--- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c
@@ -1675,9 +1675,8 @@ ngx_stream_proxy_process(ngx_stream_session_t *s, ngx_uint_t from_upstream,
size = b->end - b->last;
- if (size && src->read->ready && !src->read->delayed
- && !src->read->error)
- {
+ if (size && src->read->ready && !src->read->delayed) {
+
if (limit_rate) {
limit = (off_t) limit_rate * (ngx_time() - u->start_sec + 1)
- *received;