3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Nginx, Inc.
8 #include <ngx_config.h>
10 #include <ngx_event.h>
14 ngx_aio_read_chain(ngx_connection_t
*c
, ngx_chain_t
*cl
)
21 if (c
->read
->pending_eof
) {
30 /* we can post the single aio operation only */
32 if (!c
->read
->ready
) {
33 return total
? total
: NGX_AGAIN
;
40 /* coalesce the neighbouring bufs */
42 while (cl
&& prev
== cl
->buf
->last
) {
43 size
+= cl
->buf
->end
- cl
->buf
->last
;
48 n
= ngx_aio_read(c
, buf
, size
);
50 ngx_log_debug1(NGX_LOG_DEBUG_EVENT
, c
->log
, 0, "aio_read: %d", n
);
53 return total
? total
: NGX_AGAIN
;
61 c
->read
->pending_eof
= 1;
73 ngx_log_debug1(NGX_LOG_DEBUG_EVENT
, c
->log
, 0,
74 "aio_read total: %d", total
);
77 return total
? total
: NGX_AGAIN
;