Mercurial > hg > nginx-quic
changeset 1154:427de53e45c2
ngx_ssl_recv_chain() must not update buf->last,
it fixes proxy_pass https://...
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Sat, 31 Mar 2007 19:48:48 +0000 |
parents | c843f3df3b85 |
children | 39a3aa08eefe |
files | src/event/ngx_event_openssl.c |
diffstat | 1 files changed, 16 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/ngx_event_openssl.c +++ b/src/event/ngx_event_openssl.c @@ -547,22 +547,32 @@ ngx_ssl_handshake_handler(ngx_event_t *e ssize_t ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl) { + u_char *last; ssize_t n, bytes; ngx_buf_t *b; bytes = 0; - while (cl) { - b = cl->buf; - - n = ngx_ssl_recv(c, b->last, b->end - b->last); + b = cl->buf; + last = b->last; + + for ( ;; ) { + + n = ngx_ssl_recv(c, last, b->end - last); if (n > 0) { - b->last += n; + last += n; bytes += n; - if (b->last == b->end) { + if (last == b->end) { cl = cl->next; + + if (cl == NULL) { + return bytes; + } + + b = cl->buf; + last = b->last; } continue; @@ -574,8 +584,6 @@ ngx_ssl_recv_chain(ngx_connection_t *c, return n; } - - return bytes; }