comparison src/event/ngx_event_openssl.c @ 294:27d9d1f26b38 NGINX_0_5_17

nginx 0.5.17 *) Change: now nginx always returns the 405 status for the TRACE method. *) Feature: now nginx supports the "include" directive inside the "types" block. *) Bugfix: the $document_root variable usage in the "root" and "alias" directives is disabled: this caused recursive stack overflow. *) Bugfix: in the HTTPS protocol in the "proxy_pass" directive. *) Bugfix: in some cases non-cachable variables (such as $uri variable) returned old cached value.
author Igor Sysoev <http://sysoev.ru>
date Mon, 02 Apr 2007 00:00:00 +0400
parents c5c2b2883984
children 9b7db0df50f0
comparison
equal deleted inserted replaced
293:30378812e3af 294:27d9d1f26b38
545 545
546 546
547 ssize_t 547 ssize_t
548 ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl) 548 ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl)
549 { 549 {
550 u_char *last;
550 ssize_t n, bytes; 551 ssize_t n, bytes;
551 ngx_buf_t *b; 552 ngx_buf_t *b;
552 553
553 bytes = 0; 554 bytes = 0;
554 555
555 while (cl) { 556 b = cl->buf;
556 b = cl->buf; 557 last = b->last;
557 558
558 n = ngx_ssl_recv(c, b->last, b->end - b->last); 559 for ( ;; ) {
560
561 n = ngx_ssl_recv(c, last, b->end - last);
559 562
560 if (n > 0) { 563 if (n > 0) {
561 b->last += n; 564 last += n;
562 bytes += n; 565 bytes += n;
563 566
564 if (b->last == b->end) { 567 if (last == b->end) {
565 cl = cl->next; 568 cl = cl->next;
569
570 if (cl == NULL) {
571 return bytes;
572 }
573
574 b = cl->buf;
575 last = b->last;
566 } 576 }
567 577
568 continue; 578 continue;
569 } 579 }
570 580
572 return bytes; 582 return bytes;
573 } 583 }
574 584
575 return n; 585 return n;
576 } 586 }
577
578 return bytes;
579 } 587 }
580 588
581 589
582 ssize_t 590 ssize_t
583 ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size) 591 ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size)