Mercurial > hg > nginx
comparison src/os/unix/ngx_readv_chain.c @ 587:284cc140593b release-0.3.15
nginx-0.3.15-RELEASE import
*) 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.
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 07 Dec 2005 14:51:31 +0000 |
parents | 326634fb9d47 |
children | 5dac8c7fb71b |
comparison
equal
deleted
inserted
replaced
586:3176ab31be40 | 587:284cc140593b |
---|---|
30 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, | 30 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, |
31 "readv: eof:%d, avail:%d, err:%d", | 31 "readv: eof:%d, avail:%d, err:%d", |
32 rev->pending_eof, rev->available, rev->kq_errno); | 32 rev->pending_eof, rev->available, rev->kq_errno); |
33 | 33 |
34 if (rev->available == 0) { | 34 if (rev->available == 0) { |
35 | 35 if (rev->pending_eof) { |
36 if (!rev->pending_eof) { | |
37 return NGX_AGAIN; | |
38 } | |
39 | |
40 /* FreeBSD 5.x-6.x may erroneously report ETIMEDOUT */ | |
41 if (rev->kq_errno != NGX_ETIMEDOUT) { | |
42 | |
43 rev->ready = 0; | 36 rev->ready = 0; |
44 rev->eof = 1; | 37 rev->eof = 1; |
38 | |
39 ngx_log_error(NGX_LOG_INFO, c->log, rev->kq_errno, | |
40 "kevent() reported about an closed connection"); | |
45 | 41 |
46 if (rev->kq_errno) { | 42 if (rev->kq_errno) { |
47 rev->error = 1; | 43 rev->error = 1; |
48 ngx_set_socket_errno(rev->kq_errno); | 44 ngx_set_socket_errno(rev->kq_errno); |
49 | 45 return NGX_ERROR; |
50 return ngx_connection_error(c, rev->kq_errno, | |
51 "kevent() reported about an closed connection"); | |
52 } | 46 } |
53 | 47 |
54 return 0; | 48 return 0; |
49 | |
50 } else { | |
51 return NGX_AGAIN; | |
55 } | 52 } |
56 } | 53 } |
57 } | 54 } |
58 | 55 |
59 prev = NULL; | 56 prev = NULL; |
98 if (n >= 0) { | 95 if (n >= 0) { |
99 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { | 96 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { |
100 rev->available -= n; | 97 rev->available -= n; |
101 | 98 |
102 /* | 99 /* |
103 * rev->available can be negative here because some additional | 100 * rev->available may be negative here because some additional |
104 * bytes can be received between kevent() and recv() | 101 * bytes may be received between kevent() and recv() |
105 */ | 102 */ |
106 | 103 |
107 if (rev->available <= 0) { | 104 if (rev->available <= 0) { |
108 if (!rev->pending_eof) { | 105 if (!rev->pending_eof) { |
109 rev->ready = 0; | 106 rev->ready = 0; |