comparison src/event/ngx_event_openssl.c @ 146:36af50a5582d NGINX_0_3_20

nginx 0.3.20 *) Bugfix: in SSI handling. *) Bugfix: the ngx_http_memcached_module did not support the keys in the "/usr?args" form.
author Igor Sysoev <http://sysoev.ru>
date Wed, 11 Jan 2006 00:00:00 +0300
parents 55a211e5eeb7
children 73e8476f9142
comparison
equal deleted inserted replaced
145:85a84f8da62b 146:36af50a5582d
590 int n; 590 int n;
591 ngx_uint_t flush; 591 ngx_uint_t flush;
592 ssize_t send, size; 592 ssize_t send, size;
593 ngx_buf_t *buf; 593 ngx_buf_t *buf;
594 594
595 if (!c->ssl->buffer || (in && in->next == NULL && !c->buffered)) { 595 if (!c->ssl->buffer
596 || (in && in->next == NULL && !(c->buffered & NGX_SSL_BUFFERED)))
597 {
596 598
597 /* 599 /*
598 * we avoid a buffer copy if 600 * we avoid a buffer copy if
599 * we do not need to buffer the output 601 * we do not need to buffer the output
600 * or the incoming buf is a single and our buffer is empty 602 * or the incoming buf is a single and our buffer is empty
611 if (n == NGX_ERROR) { 613 if (n == NGX_ERROR) {
612 return NGX_CHAIN_ERROR; 614 return NGX_CHAIN_ERROR;
613 } 615 }
614 616
615 if (n == NGX_AGAIN) { 617 if (n == NGX_AGAIN) {
616 c->buffered = 1; 618 c->buffered |= NGX_SSL_BUFFERED;
617 return in; 619 return in;
618 } 620 }
619 621
620 in->buf->pos += n; 622 in->buf->pos += n;
621 623
687 if (n == NGX_ERROR) { 689 if (n == NGX_ERROR) {
688 return NGX_CHAIN_ERROR; 690 return NGX_CHAIN_ERROR;
689 } 691 }
690 692
691 if (n == NGX_AGAIN) { 693 if (n == NGX_AGAIN) {
692 c->buffered = 1; 694 c->buffered |= NGX_SSL_BUFFERED;
693 return in; 695 return in;
694 } 696 }
695 697
696 buf->pos += n; 698 buf->pos += n;
697 send += n; 699 send += n;
709 if (in == NULL || send == limit) { 711 if (in == NULL || send == limit) {
710 break; 712 break;
711 } 713 }
712 } 714 }
713 715
714 c->buffered = (buf->pos < buf->last) ? 1 : 0; 716 if (buf->pos < buf->last) {
717 c->buffered |= NGX_SSL_BUFFERED;
718
719 } else {
720 c->buffered &= ~NGX_SSL_BUFFERED;
721 }
715 722
716 return in; 723 return in;
717 } 724 }
718 725
719 726