diff src/event/ngx_event_openssl.c @ 597:9262f520ce21 release-0.3.20

nginx-0.3.20-RELEASE import *) Bugfix: in SSI handling. *) Bugfix: the ngx_http_memcached_module did not support the keys in the "/usr?args" form.
author Igor Sysoev <igor@sysoev.ru>
date Wed, 11 Jan 2006 15:26:57 +0000
parents 8c0cdd81580e
children 3f8a2132b93d
line wrap: on
line diff
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -592,7 +592,9 @@ ngx_ssl_send_chain(ngx_connection_t *c, 
     ssize_t      send, size;
     ngx_buf_t   *buf;
 
-    if (!c->ssl->buffer || (in && in->next == NULL && !c->buffered)) {
+    if (!c->ssl->buffer
+        || (in && in->next == NULL && !(c->buffered & NGX_SSL_BUFFERED)))
+    {
 
         /*
          * we avoid a buffer copy if
@@ -613,7 +615,7 @@ ngx_ssl_send_chain(ngx_connection_t *c, 
             }
 
             if (n == NGX_AGAIN) {
-                c->buffered = 1;
+                c->buffered |= NGX_SSL_BUFFERED;
                 return in;
             }
 
@@ -689,7 +691,7 @@ ngx_ssl_send_chain(ngx_connection_t *c, 
         }
 
         if (n == NGX_AGAIN) {
-            c->buffered = 1;
+            c->buffered |= NGX_SSL_BUFFERED;
             return in;
         }
 
@@ -711,7 +713,12 @@ ngx_ssl_send_chain(ngx_connection_t *c, 
         }
     }
 
-    c->buffered = (buf->pos < buf->last) ? 1 : 0;
+    if (buf->pos < buf->last) {
+        c->buffered |= NGX_SSL_BUFFERED;
+
+    } else {
+        c->buffered &= ~NGX_SSL_BUFFERED;
+    }
 
     return in;
 }