mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 09:42:39 +08:00
ngx_ssl_recv_chain() must not update buf->last,
it fixes proxy_pass https://...
This commit is contained in:
parent
24a95944a7
commit
70f65c4948
@ -547,22 +547,32 @@ ngx_ssl_handshake_handler(ngx_event_t *ev)
|
|||||||
ssize_t
|
ssize_t
|
||||||
ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl)
|
ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl)
|
||||||
{
|
{
|
||||||
|
u_char *last;
|
||||||
ssize_t n, bytes;
|
ssize_t n, bytes;
|
||||||
ngx_buf_t *b;
|
ngx_buf_t *b;
|
||||||
|
|
||||||
bytes = 0;
|
bytes = 0;
|
||||||
|
|
||||||
while (cl) {
|
b = cl->buf;
|
||||||
b = cl->buf;
|
last = b->last;
|
||||||
|
|
||||||
n = ngx_ssl_recv(c, b->last, b->end - b->last);
|
for ( ;; ) {
|
||||||
|
|
||||||
|
n = ngx_ssl_recv(c, last, b->end - last);
|
||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
b->last += n;
|
last += n;
|
||||||
bytes += n;
|
bytes += n;
|
||||||
|
|
||||||
if (b->last == b->end) {
|
if (last == b->end) {
|
||||||
cl = cl->next;
|
cl = cl->next;
|
||||||
|
|
||||||
|
if (cl == NULL) {
|
||||||
|
return bytes;
|
||||||
|
}
|
||||||
|
|
||||||
|
b = cl->buf;
|
||||||
|
last = b->last;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@ -574,8 +584,6 @@ ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl)
|
|||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
return bytes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user