diff src/os/unix/ngx_os.h @ 5913:8e903522c17a

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.
author Valentin Bartenev <vbart@nginx.com>
date Tue, 07 Oct 2014 11:38:57 +0400
parents ec81934727a1
children 2c64b69daec5
line wrap: on
line diff
--- 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_con
 #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;