]> git.kaiwu.me - nginx.git/commitdiff
r1343 merge:
authorIgor Sysoev <igor@sysoev.ru>
Sun, 29 Jul 2007 17:29:06 +0000 (17:29 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Sun, 29 Jul 2007 17:29:06 +0000 (17:29 +0000)
fix case when client has closed connection but upstream buffer is not empty

src/mail/ngx_mail_proxy_module.c

index 894c01d04b0651b3e7c4a73ec0ea48ef6cbb7a45..ae2fc4c388c704409afe64141fa8c4c0948d7a88 100644 (file)
@@ -866,9 +866,11 @@ ngx_mail_proxy_handler(ngx_event_t *ev)
 
     c->log->action = "proxying";
 
-    if ((s->connection->read->eof || s->proxy->upstream.connection->read->eof)
-        && s->buffer->pos == s->buffer->last
-        && s->proxy->buffer->pos == s->proxy->buffer->last)
+    if ((s->connection->read->eof && s->buffer->pos == s->buffer->last)
+        || (s->proxy->upstream.connection->read->eof
+            && s->proxy->buffer->pos == s->proxy->buffer->last)
+        || (s->connection->read->eof
+            && s->proxy->upstream.connection->read->eof))
     {
         action = c->log->action;
         c->log->action = NULL;