Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_aio_read_chain.c @ 566:be4f34123024 NGINX_0_8_35
nginx 0.8.35
*) Change: now the charset filter runs before the SSI filter.
*) Feature: the "chunked_transfer_encoding" directive.
*) Bugfix: an "&" character was not escaped when it was copied in
arguments part in a rewrite rule.
*) Bugfix: nginx might be terminated abnormally while a signal
processing or if the directive "timer_resolution" was used on
platforms which do not support kqueue or eventport notification
methods.
Thanks to George Xie and Maxim Dounin.
*) Bugfix: if temporary files and permanent storage area resided at
different file systems, then permanent file modification times were
incorrect.
Thanks to Maxim Dounin.
*) Bugfix: ngx_http_memcached_module might issue the error message
"memcached sent invalid trailer".
Thanks to Maxim Dounin.
*) Bugfix: nginx could not built zlib-1.2.4 library using the library
sources.
Thanks to Maxim Dounin.
*) Bugfix: a segmentation fault occurred in a worker process, if there
was large stderr output before FastCGI response; the bug had
appeared in 0.8.34.
Thanks to Maxim Dounin.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Mon, 29 Mar 2010 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 } |