Mercurial > hg > nginx-vendor-1-0
annotate src/os/unix/ngx_udp_recv.c @ 644:ad25218fd14b NGINX_1_0_12
nginx 1.0.12
*) Feature: the "TLSv1.1" and "TLSv1.2" parameters of the
"ssl_protocols" directive.
*) Feature: the "if" SSI command supports captures in regular
expressions.
*) Bugfix: the "if" SSI command did not work inside the "block" command.
*) Bugfix: in AIO error handling on FreeBSD.
*) Bugfix: in the OpenSSL library initialization.
*) Bugfix: the "worker_cpu_affinity" directive might not work.
*) Bugfix: the "limit_conn_log_level" and "limit_req_log_level"
directives might not work.
*) Bugfix: the "read_ahead" directive might not work combined with
"try_files" and "open_file_cache".
*) Bugfix: the "proxy_cache_use_stale" directive with "error" parameter
did not return answer from cache if there were no live upstreams.
*) Bugfix: a segmentation fault might occur in a worker process if small
time was used in the "inactive" parameter of the "proxy_cache_path"
directive.
*) Bugfix: responses from cache might hang.
*) Bugfix: in error handling while connecting to a backend.
Thanks to Piotr Sikora.
*) Bugfix: in the "epoll" event method.
Thanks to Yichun Zhang.
*) Bugfix: the $sent_http_cache_control variable might contain a wrong
value if the "expires" directive was used.
Thanks to Yichun Zhang.
*) Bugfix: the "limit_rate" directive did not allow to use full
throughput, even if limit value was very high.
*) Bugfix: the "sendfile_max_chunk" directive did not work, if the
"limit_rate" directive was used.
*) Bugfix: nginx could not be built on Solaris; the bug had appeared in
1.0.11.
*) Bugfix: in the ngx_http_scgi_module.
*) Bugfix: in the ngx_http_mp4_module.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 06 Feb 2012 00:00:00 +0400 |
parents | c456a023113c |
children |
rev | line source |
---|---|
354 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
644 | 4 * Copyright (C) Nginx, Inc. |
354 | 5 */ |
6 | |
7 | |
8 #include <ngx_config.h> | |
9 #include <ngx_core.h> | |
10 #include <ngx_event.h> | |
11 | |
12 | |
13 #if (NGX_HAVE_KQUEUE) | |
14 | |
15 ssize_t | |
16 ngx_udp_unix_recv(ngx_connection_t *c, u_char *buf, size_t size) | |
17 { | |
18 ssize_t n; | |
19 ngx_err_t err; | |
20 ngx_event_t *rev; | |
21 | |
22 rev = c->read; | |
23 | |
24 do { | |
25 n = recv(c->fd, buf, size, 0); | |
26 | |
27 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, | |
28 "recv: fd:%d %d of %d", c->fd, n, size); | |
29 | |
30 if (n >= 0) { | |
31 if (ngx_event_flags & NGX_USE_KQUEUE_EVENT) { | |
32 rev->available -= n; | |
33 | |
34 /* | |
35 * rev->available may be negative here because some additional | |
36 * bytes may be received between kevent() and recv() | |
37 */ | |
38 | |
39 if (rev->available <= 0) { | |
40 rev->ready = 0; | |
41 rev->available = 0; | |
42 } | |
43 } | |
44 | |
45 return n; | |
46 } | |
47 | |
48 err = ngx_socket_errno; | |
49 | |
50 if (err == NGX_EAGAIN || err == NGX_EINTR) { | |
51 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err, | |
52 "recv() not ready"); | |
53 n = NGX_AGAIN; | |
54 | |
55 } else { | |
56 n = ngx_connection_error(c, err, "recv() failed"); | |
57 break; | |
58 } | |
59 | |
60 } while (err == NGX_EINTR); | |
61 | |
62 rev->ready = 0; | |
63 | |
582 | 64 if (n == NGX_ERROR) { |
354 | 65 rev->error = 1; |
66 } | |
67 | |
68 return n; | |
69 } | |
70 | |
71 #else /* ! NGX_HAVE_KQUEUE */ | |
72 | |
73 ssize_t | |
74 ngx_udp_unix_recv(ngx_connection_t *c, u_char *buf, size_t size) | |
75 { | |
76 ssize_t n; | |
77 ngx_err_t err; | |
78 ngx_event_t *rev; | |
79 | |
80 rev = c->read; | |
81 | |
82 do { | |
83 n = recv(c->fd, buf, size, 0); | |
84 | |
85 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, c->log, 0, | |
86 "recv: fd:%d %d of %d", c->fd, n, size); | |
87 | |
88 if (n >= 0) { | |
89 return n; | |
90 } | |
91 | |
92 err = ngx_socket_errno; | |
93 | |
94 if (err == NGX_EAGAIN || err == NGX_EINTR) { | |
95 ngx_log_debug0(NGX_LOG_DEBUG_EVENT, c->log, err, | |
96 "recv() not ready"); | |
97 n = NGX_AGAIN; | |
98 | |
99 } else { | |
100 n = ngx_connection_error(c, err, "recv() failed"); | |
101 break; | |
102 } | |
103 | |
104 } while (err == NGX_EINTR); | |
105 | |
106 rev->ready = 0; | |
107 | |
582 | 108 if (n == NGX_ERROR) { |
354 | 109 rev->error = 1; |
110 } | |
111 | |
112 return n; | |
113 } | |
114 | |
115 #endif /* NGX_HAVE_KQUEUE */ |