mirror of
https://github.com/nginx/nginx.git
synced 2025-06-06 17:02:39 +08:00
fix segfault in SSL if limit_rate is used
This commit is contained in:
parent
956bdfc000
commit
cc65b0879b
@ -946,7 +946,7 @@ ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
|
|
||||||
for ( ;; ) {
|
for ( ;; ) {
|
||||||
|
|
||||||
while (in && buf->last < buf->end) {
|
while (in && buf->last < buf->end && send < limit) {
|
||||||
if (in->buf->last_buf || in->buf->flush) {
|
if (in->buf->last_buf || in->buf->flush) {
|
||||||
flush = 1;
|
flush = 1;
|
||||||
}
|
}
|
||||||
@ -973,8 +973,8 @@ ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
ngx_memcpy(buf->last, in->buf->pos, size);
|
ngx_memcpy(buf->last, in->buf->pos, size);
|
||||||
|
|
||||||
buf->last += size;
|
buf->last += size;
|
||||||
|
|
||||||
in->buf->pos += size;
|
in->buf->pos += size;
|
||||||
|
send += size;
|
||||||
|
|
||||||
if (in->buf->pos == in->buf->last) {
|
if (in->buf->pos == in->buf->last) {
|
||||||
in = in->next;
|
in = in->next;
|
||||||
@ -999,7 +999,6 @@ ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
buf->pos += n;
|
buf->pos += n;
|
||||||
send += n;
|
|
||||||
c->sent += n;
|
c->sent += n;
|
||||||
|
|
||||||
if (n < size) {
|
if (n < size) {
|
||||||
|
Loading…
Reference in New Issue
Block a user