Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_aio_read_chain.c @ 650:4d05413aebad NGINX_1_1_9
nginx 1.1.9
*) Change: now double quotes are encoded in an "echo" SSI-command
output.
Thanks to Zaur Abasmirzoev.
*) Feature: the "valid" parameter of the "resolver" directive. By
default TTL returned by a DNS server is used.
Thanks to Kirill A. Korinskiy.
*) Bugfix: nginx might hang after a worker process abnormal termination.
*) Bugfix: a segmentation fault might occur in a worker process if SNI
was used; the bug had appeared in 1.1.2.
*) Bugfix: in the "keepalive_disable" directive; the bug had appeared in
1.1.8.
Thanks to Alexander Usov.
*) Bugfix: SIGWINCH signal did not work after first binary upgrade; the
bug had appeared in 1.1.1.
*) Bugfix: backend responses with length not matching "Content-Length"
header line are no longer cached.
*) Bugfix: in the "scgi_param" directive, if complex parameters were
used.
*) Bugfix: in the "epoll" event method.
Thanks to Yichun Zhang.
*) Bugfix: in the ngx_http_flv_module.
Thanks to Piotr Sikora.
*) Bugfix: in the ngx_http_mp4_module.
*) Bugfix: IPv6 addresses are now handled properly in a request line and
in a "Host" request header line.
*) Bugfix: "add_header" and "expires" directives did not work if a
request was proxied and response status code was 206.
*) Bugfix: nginx could not be built on FreeBSD 10.
*) Bugfix: nginx could not be built on AIX.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 28 Nov 2011 00:00:00 +0400 |
parents | 86dad910eeb6 |
children | d0f7a625f27c |
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 | |
11 | |
126 | 12 ssize_t |
13 ngx_aio_read_chain(ngx_connection_t *c, ngx_chain_t *cl) | |
0 | 14 { |
15 int n; | |
16 u_char *buf, *prev; | |
17 size_t size; | |
18 ssize_t total; | |
19 | |
20 if (c->read->pending_eof) { | |
21 c->read->ready = 0; | |
22 return 0; | |
23 } | |
24 | |
25 total = 0; | |
26 | |
27 while (cl) { | |
28 | |
29 /* we can post the single aio operation only */ | |
30 | |
31 if (!c->read->ready) { | |
32 return total ? total : NGX_AGAIN; | |
33 } | |
34 | |
35 buf = cl->buf->last; | |
36 prev = cl->buf->last; | |
37 size = 0; | |
38 | |
39 /* coalesce the neighbouring bufs */ | |
40 | |
41 while (cl && prev == cl->buf->last) { | |
42 size += cl->buf->end - cl->buf->last; | |
43 prev = cl->buf->end; | |
44 cl = cl->next; | |
45 } | |
46 | |
47 n = ngx_aio_read(c, buf, size); | |
48 | |
49 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "aio_read: %d", n); | |
50 | |
51 if (n == NGX_AGAIN) { | |
52 return total ? total : NGX_AGAIN; | |
53 } | |
54 | |
55 if (n == NGX_ERROR) { | |
56 return NGX_ERROR; | |
57 } | |
58 | |
59 if (n == 0) { | |
60 c->read->pending_eof = 1; | |
61 if (total) { | |
62 c->read->eof = 0; | |
63 c->read->ready = 1; | |
64 } | |
65 return total; | |
66 } | |
67 | |
68 if (n > 0) { | |
69 total += n; | |
70 } | |
71 | |
72 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, | |
73 "aio_read total: %d", total); | |
74 } | |
75 | |
76 return total ? total : NGX_AGAIN; | |
77 } |