diff options
author | Valentin Bartenev <vbart@nginx.com> | 2014-10-07 11:38:57 +0400 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2014-10-07 11:38:57 +0400 |
commit | b29d599c0b2459e4d8ebde1113d2738cf48f44eb (patch) | |
tree | 4dce76d2e51aac59384040ef8eb0a6e7a92f844b /src/os/unix/ngx_os.h | |
parent | 41ed9734561fc957a64ca7e4dab5a8c6e3ac3c0b (diff) | |
download | nginx-b29d599c0b2459e4d8ebde1113d2738cf48f44eb.tar.gz nginx-b29d599c0b2459e4d8ebde1113d2738cf48f44eb.zip |
Introduced the ngx_output_chain_to_iovec() function.
It deduplicates code of the send chain functions and uses only preallocated
memory, which completely solves the problem mentioned in d1bde5c3c5d2.
Diffstat (limited to 'src/os/unix/ngx_os.h')
-rw-r--r-- | src/os/unix/ngx_os.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/os/unix/ngx_os.h b/src/os/unix/ngx_os.h index a1586426c..fa6a6a6ce 100644 --- a/src/os/unix/ngx_os.h +++ b/src/os/unix/ngx_os.h @@ -64,6 +64,17 @@ ngx_chain_t *ngx_aio_write_chain(ngx_connection_t *c, ngx_chain_t *in, #endif +typedef struct { + struct iovec *iovs; + ngx_uint_t count; + size_t size; + ngx_uint_t nalloc; +} ngx_iovec_t; + +ngx_chain_t *ngx_output_chain_to_iovec(ngx_iovec_t *vec, ngx_chain_t *in, + size_t limit, ngx_log_t *log); + + extern ngx_os_io_t ngx_os_io; extern ngx_int_t ngx_ncpu; extern ngx_int_t ngx_max_sockets; |