Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_aio_read_chain.c @ 112:408f195b3482 NGINX_0_3_3
nginx 0.3.3
*) Change: the "bl" and "af" parameters of the "listen" directive was
renamed to the "backlog" and "accept_filter".
*) Feature: the "rcvbuf" and "sndbuf" parameters of the "listen"
directive.
*) Change: the "$msec" log parameter does not require now the
additional the gettimeofday() system call.
*) Feature: the -t switch now tests the "listen" directives.
*) Bugfix: if the invalid address was specified in the "listen"
directive, then after the -HUP signal nginx left an open socket in
the CLOSED state.
*) Bugfix: the mime type may be incorrectly set to default value for
index file with variable in the name; bug appeared in 0.3.0.
*) Feature: the "timer_resolution" directive.
*) Feature: the millisecond "$upstream_response_time" log parameter.
*) Bugfix: a temporary file with client request body now is removed
just after the response header was transferred to a client.
*) Bugfix: OpenSSL 0.9.6 compatibility.
*) Bugfix: the SSL certificate and key file paths could not be relative.
*) Bugfix: the "ssl_prefer_server_ciphers" directive did not work in
the ngx_imap_ssl_module.
*) Bugfix: the "ssl_protocols" directive allowed to specify the single
protocol only.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Wed, 19 Oct 2005 00:00:00 +0400 |
parents | 72eb30262aac |
children | df17fbafec8f |
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 | |
12 | |
13 ssize_t ngx_aio_read_chain(ngx_connection_t *c, ngx_chain_t *cl) | |
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 } |