Mercurial > hg > nginx-vendor-0-7
annotate src/os/unix/ngx_aio_read.c @ 502:89dc5654117c NGINX_0_7_63
nginx 0.7.63
*) Security: now "/../" are disabled in "Destination" request header
line.
*) Change: minimum supported OpenSSL version is 0.9.7.
*) Change: the "ask" parameter of the "ssl_verify_client" directive was
changed to the "optional" parameter and now it checks a client
certificate if it was offered.
Thanks to Brice Figureau.
*) Feature: now the "-V" switch shows TLS SNI support.
*) Feature: the $ssl_client_verify variable.
Thanks to Brice Figureau.
*) Feature: the "ssl_crl" directive.
Thanks to Brice Figureau.
*) Bugfix: the $ssl_client_cert variable usage corrupted memory; the
bug had appeared in 0.7.7.
Thanks to Sergey Zhuravlev.
*) Feature: now the start cache loader runs in a separate process; this
should improve large caches handling.
*) Feature: now temporary files and permanent storage area may reside
at different file systems.
*) Bugfix: nginx counted incorrectly disk cache size.
*) Change: now directive "gzip_disable msie6" does not disable gzipping
for MSIE 6.0 SV1.
*) Bugfix: nginx always added "Vary: Accept-Encoding" response header
line, if both "gzip_static" and "gzip_vary" were on.
*) Feature: the "proxy" parameter of the "geo" directive.
*) Feature: the ngx_http_geoip_module.
*) Feature: the "limit_rate_after" directive.
Thanks to Ivan Debnar.
*) Feature: the "limit_req_log_level" and "limit_conn_log_level"
directives.
*) Bugfix: now "limit_req" directive conforms to the leaky bucket
algorithm.
Thanks to Maxim Dounin.
*) Bugfix: in ngx_http_limit_req_module.
Thanks to Maxim Dounin.
*) Bugfix: now nginx allows underscores in a request method.
*) Bugfix: "proxy_pass_header" and "fastcgi_pass_header" directives did
not pass to a client the "X-Accel-Redirect", "X-Accel-Limit-Rate",
"X-Accel-Buffering", and "X-Accel-Charset" lines from backend
response header.
Thanks to Maxim Dounin.
*) Bugfix: in handling "Last-Modified" and "Accept-Ranges" backend
response header lines; the bug had appeared in 0.7.44.
Thanks to Maxim Dounin.
*) Feature: the "image_filter_transparency" directive.
*) Feature: the "image_filter" directive supports variables for setting
size.
*) Bugfix: in PNG alpha-channel support in the
ngx_http_image_filter_module.
*) Bugfix: in transparency support in the ngx_http_image_filter_module.
*) Feature: now several "perl_modules" directives may be used.
*) Bugfix: ngx_http_perl_module responses did not work in subrequests.
*) Bugfix: nginx sent '\0' in a "Location" response header line on
MKCOL request.
Thanks to Xie Zhenye.
*) Bugfix: an "error_page" directive did not redirect a 413 error; the
bug had appeared in 0.6.10.
*) Bugfix: in memory allocation error handling.
Thanks to Maxim Dounin and Kirill A. Korinskiy.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 26 Oct 2009 00:00:00 +0300 |
parents | df17fbafec8f |
children |
rev | line source |
---|---|
0 | 1 |
2 /* | |
3 * Copyright (C) Igor Sysoev | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 #include <ngx_event.h> | |
10 #include <ngx_aio.h> | |
11 | |
18 | 12 #if (NGX_HAVE_KQUEUE) |
0 | 13 #include <ngx_kqueue_module.h> |
14 #endif | |
15 | |
16 | |
17 /* | |
18 * the ready data requires 3 syscalls: | |
19 * aio_write(), aio_error(), aio_return() | |
20 * the non-ready data requires 4 (kqueue) or 5 syscalls: | |
21 * aio_write(), aio_error(), notifiction, aio_error(), aio_return() | |
22 * timeout, aio_cancel(), aio_error() | |
23 */ | |
24 | |
126 | 25 ssize_t |
26 ngx_aio_read(ngx_connection_t *c, u_char *buf, size_t size) | |
0 | 27 { |
28 int n; | |
29 ngx_event_t *rev; | |
30 | |
31 rev = c->read; | |
32 | |
33 if (!rev->ready) { | |
34 ngx_log_error(NGX_LOG_ALERT, c->log, 0, "second aio post"); | |
35 return NGX_AGAIN; | |
36 } | |
37 | |
38 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | |
39 "rev->complete: %d", rev->complete); | |
40 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | |
41 "aio size: %d", size); | |
42 | |
43 if (!rev->complete) { | |
44 ngx_memzero(&rev->aiocb, sizeof(struct aiocb)); | |
45 | |
46 rev->aiocb.aio_fildes = c->fd; | |
47 rev->aiocb.aio_buf = buf; | |
48 rev->aiocb.aio_nbytes = size; | |
49 | |
18 | 50 #if (NGX_HAVE_KQUEUE) |
0 | 51 rev->aiocb.aio_sigevent.sigev_notify_kqueue = ngx_kqueue; |
52 rev->aiocb.aio_sigevent.sigev_notify = SIGEV_KEVENT; | |
53 rev->aiocb.aio_sigevent.sigev_value.sigval_ptr = rev; | |
54 #endif | |
55 | |
56 if (aio_read(&rev->aiocb) == -1) { | |
57 ngx_log_error(NGX_LOG_CRIT, rev->log, ngx_errno, | |
58 "aio_read() failed"); | |
59 rev->error = 1; | |
60 return NGX_ERROR; | |
61 } | |
62 | |
63 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | |
64 "aio_read: #%d OK", c->fd); | |
65 | |
66 rev->active = 1; | |
67 rev->ready = 0; | |
68 } | |
69 | |
70 rev->complete = 0; | |
71 | |
72 n = aio_error(&rev->aiocb); | |
73 if (n == -1) { | |
74 ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno, "aio_error() failed"); | |
75 rev->error = 1; | |
76 return NGX_ERROR; | |
77 } | |
78 | |
79 if (n != 0) { | |
80 if (n == NGX_EINPROGRESS) { | |
81 if (rev->ready) { | |
82 ngx_log_error(NGX_LOG_ALERT, c->log, n, | |
83 "aio_read() still in progress"); | |
84 rev->ready = 0; | |
85 } | |
86 return NGX_AGAIN; | |
87 } | |
88 | |
89 ngx_log_error(NGX_LOG_CRIT, c->log, n, "aio_read() failed"); | |
90 rev->error = 1; | |
91 rev->ready = 0; | |
92 return NGX_ERROR; | |
93 } | |
94 | |
95 n = aio_return(&rev->aiocb); | |
96 if (n == -1) { | |
97 ngx_log_error(NGX_LOG_ALERT, c->log, ngx_errno, | |
98 "aio_return() failed"); | |
99 | |
100 rev->error = 1; | |
101 rev->ready = 0; | |
102 return NGX_ERROR; | |
103 } | |
104 | |
105 ngx_log_debug2(NGX_LOG_DEBUG_EVENT, rev->log, 0, | |
106 "aio_read: #%d %d", c->fd, n); | |
107 | |
108 if (n == 0) { | |
109 rev->eof = 1; | |
110 rev->ready = 0; | |
111 } else { | |
112 rev->ready = 1; | |
113 } | |
114 | |
115 rev->active = 0; | |
116 | |
117 return n; | |
118 } |