Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_udp_recv.c @ 694:88a1b4797f2e NGINX_1_3_10
nginx 1.3.10
*) Change: domain names specified in configuration file are now resolved
to IPv6 addresses as well as IPv4 ones.
*) Change: now if the "include" directive with mask is used on Unix
systems, included files are sorted in alphabetical order.
*) Change: the "add_header" directive adds headers to 201 responses.
*) Feature: the "geo" directive now supports IPv6 addresses in CIDR
notation.
*) Feature: the "flush" and "gzip" parameters of the "access_log"
directive.
*) Feature: variables support in the "auth_basic" directive.
*) Bugfix: nginx could not be built with the ngx_http_perl_module in
some cases.
*) Bugfix: a segmentation fault might occur in a worker process if the
ngx_http_xslt_module was used.
*) Bugfix: nginx could not be built on MacOSX in some cases.
Thanks to Piotr Sikora.
*) Bugfix: the "limit_rate" directive with high rates might result in
truncated responses on 32-bit platforms.
Thanks to Alexey Antropov.
*) Bugfix: a segmentation fault might occur in a worker process if the
"if" directive was used.
Thanks to Piotr Sikora.
*) Bugfix: a "100 Continue" response was issued with "413 Request Entity
Too Large" responses.
*) Bugfix: the "image_filter", "image_filter_jpeg_quality" and
"image_filter_sharpen" directives might be inherited incorrectly.
Thanks to Ian Babrou.
*) Bugfix: "crypt_r() failed" errors might appear if the "auth_basic"
directive was used on Linux.
*) Bugfix: in backup servers handling.
Thanks to Thomas Chen.
*) Bugfix: proxied HEAD requests might return incorrect response if the
"gzip" directive was used.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 25 Dec 2012 00:00:00 +0400 |
parents | d0f7a625f27c |
children |
rev | line source |
---|---|
354 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
660 | 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 */ |