aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_recv.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-12-07 14:51:31 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-12-07 14:51:31 +0000
commitcdc463042b9406e4703d21202bc363e86321bb5d (patch)
tree1f6d050377dafbf42bb3d7c8c7e15e86939500ff /src/os/unix/ngx_recv.c
parentc20f0c28ff5478dcafd2ce2e5056da3757eb62ff (diff)
downloadnginx-cdc463042b9406e4703d21202bc363e86321bb5d.tar.gz
nginx-cdc463042b9406e4703d21202bc363e86321bb5d.zip
nginx-0.3.15-RELEASE importrelease-0.3.15
*) Feature: the new 444 code of the "return" directive to close connection. *) Feature: the "so_keepalive" directive in IMAP/POP3 proxy. *) Bugfix: if there are unclosed connection nginx now calls abort() only on gracefull quit and active "debug_points" directive.
Diffstat (limited to 'src/os/unix/ngx_recv.c')
-rw-r--r--src/os/unix/ngx_recv.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/os/unix/ngx_recv.c b/src/os/unix/ngx_recv.c
index a9064307a..0d3872969 100644
--- a/src/os/unix/ngx_recv.c
+++ b/src/os/unix/ngx_recv.c
@@ -25,14 +25,7 @@ ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
rev->pending_eof, rev->available, rev->kq_errno);
if (rev->available == 0) {
-
- if (!rev->pending_eof) {
- return NGX_AGAIN;
- }
-
- /* FreeBSD 5.x-6.x may erroneously report ETIMEDOUT */
- if (rev->kq_errno != NGX_ETIMEDOUT) {
-
+ if (rev->pending_eof) {
rev->ready = 0;
rev->eof = 1;
@@ -45,6 +38,9 @@ ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
}
return 0;
+
+ } else {
+ return NGX_AGAIN;
}
}
}
@@ -61,7 +57,7 @@ ssize_t ngx_unix_recv(ngx_connection_t *c, u_char *buf, size_t size)
/*
* rev->available may be negative here because some additional
- * bytes can be received between kevent() and recv()
+ * bytes may be received between kevent() and recv()
*/
if (rev->available <= 0) {