Mercurial > hg > nginx
comparison src/stream/ngx_stream_proxy_module.c @ 8110:06c7d84cafdb
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 01 Dec 2022 04:22:31 +0300 |
parents | 17d6a537fb1b |
children | d1cf09451ae8 91ad1abfb285 |
comparison
equal
deleted
inserted
replaced
8109:2ffefe2f892e | 8110:06c7d84cafdb |
---|---|
1673 } | 1673 } |
1674 } | 1674 } |
1675 | 1675 |
1676 size = b->end - b->last; | 1676 size = b->end - b->last; |
1677 | 1677 |
1678 if (size && src->read->ready && !src->read->delayed | 1678 if (size && src->read->ready && !src->read->delayed) { |
1679 && !src->read->error) | 1679 |
1680 { | |
1681 if (limit_rate) { | 1680 if (limit_rate) { |
1682 limit = (off_t) limit_rate * (ngx_time() - u->start_sec + 1) | 1681 limit = (off_t) limit_rate * (ngx_time() - u->start_sec + 1) |
1683 - *received; | 1682 - *received; |
1684 | 1683 |
1685 if (limit <= 0) { | 1684 if (limit <= 0) { |