summaryrefslogtreecommitdiffhomepage
path: root/src/os/unix/ngx_linux_sendfile_chain.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-14Added support for offloading Linux sendfile() in thread pools.Valentin Bartenev1-8/+183
2015-02-27Refactored ngx_linux_sendfile_chain() even more.Valentin Bartenev1-46/+60
The code that calls sendfile() was cut into a separate function. This simplifies EINTR processing, yet is needed for the following changes that add threads support.
2014-11-19Fixed type of sendfile() return value on Linux.Valentin Bartenev1-6/+6
There was no real problem since the amount of bytes can be sent is limited by NGX_SENDFILE_MAXSIZE to less than 2G. But that can be changed in the future
2014-08-13Moved writev() handling code to a separate function.Valentin Bartenev1-23/+5
This reduces code duplication and unifies debug logging of the writev() syscall among various send chain functions.
2014-08-13Merged conditions in the ngx_*_sendfile_chain() functions.Valentin Bartenev1-5/+0
No functional changes.
2014-08-13Moved the code for coalescing file buffers to a separate function.Valentin Bartenev1-24/+3
2014-10-07Introduced the ngx_output_chain_to_iovec() function.Valentin Bartenev1-69/+11
It deduplicates code of the send chain functions and uses only preallocated memory, which completely solves the problem mentioned in d1bde5c3c5d2.
2014-11-19Renamed ngx_handle_sent_chain() to ngx_chain_update_sent().Valentin Bartenev1-1/+1
No functional changes.
2014-08-27Fixed counting of sent bytes in the send chain functions on EINTR.Valentin Bartenev1-0/+1
Previously, a value of the "send" variable wasn't properly adjusted in a rare case when syscall was interrupted by a signal. As a result, these functions could send less data than the limit allows.
2014-08-13Generalized definitions of the number of preallocated iovec's.Valentin Bartenev1-9/+2
No functional changes.
2014-08-13Removed the "complete" variable from various send chain functions.Valentin Bartenev1-7/+2
It was made redundant by the previous change, since the "sent" variable is no longer modified.
2014-08-13Moved the code for adjusting sent buffers in a separate function.Valentin Bartenev1-36/+1
2014-02-03Use ngx_socket_errno where appropriate.Piotr Sikora1-2/+2
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-08-15Unbreak building on Linux without sendfile64() support.Valentin Bartenev1-3/+3
It was broken in 8e446a2daf48 when the NGX_SENDFILE_LIMIT constant was added to ngx_linux_sendfile_chain.c having the same name as already defined one in ngx_linux_config.h. The newer is needed to overcome a bug in old Linux kernels by limiting the number of bytes to send per sendfile() syscall. The older is used with sendfile() on ancient kernels that works with 32-bit offsets only. One of these renamed to NGX_SENDFILE_MAXSIZE.
2013-08-08Don't lose pointer to first nonempty buf in ngx_*_sendfile_chain().Gleb Smirnoff1-16/+14
In ngx_*_sendfile_chain() when calculating pointer to a first non-zero sized buf, use "in" as iterator. This fixes processing of zero sized buf(s) after EINTR. Otherwise function can return zero sized buf to caller, and later ngx_http_write_filter() logs warning.
2013-05-21Style: remove unnecessary references to HTTP from non-HTTP modules.Piotr Sikora1-1/+1
No functional changes. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2012-04-17IOV_MAX handling microoptimization.Maxim Dounin1-4/+6
We now stop on IOV_MAX iovec entries only if we are going to add new one, i.e. next buffer can't be coalesced into last iovec. This also fixes incorrect checks for trailer creation on FreeBSD and Mac OS X, header.nelts was checked instead of trailer.nelts.
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2009-08-30refactor EAGAIN/EINTR processingIgor Sysoev1-14/+20
2007-07-29make 64-bit ngx_int_t on 64-bit platformsIgor Sysoev1-1/+1
2007-05-07add debug logIgor Sysoev1-0/+4
2007-04-23fix sendfile on 64-bit Linux and limit_rate on all 64-bit platformsIgor Sysoev1-1/+1
for 2G+ files
2006-09-07workaround of 2G+ file bug in 64-bit Linux sendfile()Igor Sysoev1-4/+10
2006-01-11nginx-0.3.20-RELEASE importrelease-0.3.20Igor Sysoev1-1/+5
*) Bugfix: in SSI handling. *) Bugfix: the ngx_http_memcached_module did not support the keys in the "/usr?args" form.
2005-12-16nginx-0.3.16-RELEASE importrelease-0.3.16Igor Sysoev1-13/+19
*) Feature: the ngx_http_map_module. *) Feature: the "types_hash_max_size" and "types_hash_bucket_size" directives. *) Feature: the "ssi_value_length" directive. *) Feature: the "worker_rlimit_core" directive. *) Workaround: the connection number in logs was always 1 if nginx was built by the icc 8.1 or 9.0 compilers with optimization for Pentium 4. *) Bugfix: the "config timefmt" SSI command set incorrect time format. *) Bugfix: nginx did not close connection to IMAP/POP3 backend for the SSL connections; the bug had appeared in 0.3.13. Thanks to Rob Mueller. *) Bugfix: segmentation fault may occurred in at SSL shutdown; the bug had appeared in 0.3.13.
2005-12-05nginx-0.3.14-RELEASE importrelease-0.3.14Igor Sysoev1-2/+2
*) Bugfix: in the 304 response the body was transferred; the bug had appeared in 0.3.13.
2005-11-15nginx-0.3.10-RELEASE importrelease-0.3.10Igor Sysoev1-6/+6
*) Change: the "valid_referers" directive and the "$invalid_referer" variable were moved to the new ngx_http_referer_module from the ngx_http_rewrite_module. *) Change: the "$apache_bytes_sent" variable name was changed to "$body_bytes_sent". *) Feature: the "$sent_http_..." variables. *) Feature: the "if" directive supports the "=" and "!=" operations. *) Feature: the "proxy_pass" directive supports the HTTPS protocol. *) Feature: the "proxy_set_body" directive. *) Feature: the "post_action" directive. *) Feature: the ngx_http_empty_gif_module. *) Feature: the "worker_cpu_affinity" directive for Linux. *) Bugfix: the "rewrite" directive did not unescape URI part in redirect, now it is unescaped except the %00-%25 and %7F-%FF characters. *) Bugfix: nginx could not be built by the icc 9.0 compiler. *) Bugfix: if the SSI was enabled for zero size static file, then the chunked response was encoded incorrectly.
2005-03-19nginx-0.1.25-RELEASE importrelease-0.1.25Igor Sysoev1-1/+2
*) Bugfix: nginx did run on Linux parisc. *) Feature: nginx now does not start under FreeBSD if the sysctl kern.ipc.somaxconn value is too big. *) Bugfix: if a request was internally redirected by the ngx_http_index_module module to the ngx_http_proxy_module or ngx_http_fastcgi_module modules, then the index file was not closed after request completion. *) Feature: the "proxy_pass" can be used in location with regular expression. *) Feature: the ngx_http_rewrite_filter_module module supports the condition like "if ($HTTP_USER_AGENT ~ MSIE)". *) Bugfix: nginx started too slow if the large number of addresses and text values were used in the "geo" directive. *) Change: a variable name must be declared as "$name" in the "geo" directive. The previous variant without "$" is still supported, but will be removed soon. *) Feature: the "%{VARIABLE}v" logging parameter. *) Feature: the "set $name value" directive. *) Bugfix: gcc 4.0 compatibility. *) Feature: the --with-openssl-opt=OPTIONS autoconfiguration directive.
2005-02-16nginx-0.1.19-RELEASE importrelease-0.1.19Igor Sysoev1-0/+2
*) Bugfix: now, if request contains the zero, then the 404 error is returned for the local requests. *) Bugfix: nginx could not be built on NetBSD 2.0. *) Bugfix: the timeout may occur while reading of the the client request body via SSL connections.
2005-01-25nginx-0.1.16-RELEASE importrelease-0.1.16Igor Sysoev1-5/+16
*) Bugfix: if the response were transferred by chunks, then on the HEAD request the final chunk was issued. *) Bugfix: the "Connection: keep-alive" header were issued, even if the keepalive_timeout directive forbade the keep-alive use. *) Bugfix: the errors in the ngx_http_fastcgi_module caused the segmentation faults. *) Bugfix: the compressed response encrypted by SSL may not transferred complete. *) Bugfix: the TCP-specific TCP_NODELAY, TCP_NOPSUH, and TCP_CORK options, are not used for the unix domain sockets. *) Feature: the rewrite directive supports the arguments rewriting. *) Bugfix: the response code 400 was returned for the POST request with the "Content-Length: 0" header; the bug had appeared in 0.1.14.
2005-01-18nginx-0.1.14-RELEASE importrelease-0.1.14Igor Sysoev1-6/+14
*) Feature: the autoconfiguration directives: --http-client-body-temp-path=PATH, --http-proxy-temp-path=PATH, and --http-fastcgi-temp-path=PATH *) Change: the directory name for the temporary files with the client request body is specified by directive client_body_temp_path, by default it is <prefix>/client_body_temp. *) Feature: the ngx_http_fastcgi_module and the directives: fastcgi_pass, fastcgi_root, fastcgi_index, fastcgi_params, fastcgi_connect_timeout, fastcgi_send_timeout, fastcgi_read_timeout, fastcgi_send_lowat, fastcgi_header_buffer_size, fastcgi_buffers, fastcgi_busy_buffers_size, fastcgi_temp_path, fastcgi_max_temp_file_size, fastcgi_temp_file_write_size, fastcgi_next_upstream, and fastcgi_x_powered_by. *) Bugfix: the "[alert] zero size buf" error; the bug had appeared in 0.1.3. *) Change: the URI must be specified after the host name in the proxy_pass directive. *) Change: the %3F symbol in the URI was considered as the argument string start. *) Feature: the unix domain sockets support in the ngx_http_proxy_module. *) Feature: the ssl_engine and ssl_ciphers directives. Thanks to Sergey Skvortsov for SSL-accelerator.
2004-12-21nginx-0.1.13-RELEASE importrelease-0.1.13Igor Sysoev1-2/+2
*) Feature: the server_names_hash and server_names_hash_threshold directives. *) Bugfix: the *.domain.tld names in the "server_name" directive did not work. *) Bugfix: the %request_length log parameter logged the incorrect length.
2004-12-02nginx-0.1.11-RELEASE importrelease-0.1.11Igor Sysoev1-31/+75
*) Feature: the worker_priority directive. *) Change: both tcp_nopush and tcp_nodelay directives affect the transferred response. *) Bugfix: nginx did not call initgroups(). Thanks to Andrew Sitnikov and Andrei Nigmatulin. *) Change: now the ngx_http_autoindex_module shows the file size in the bytes. *) Bugfix: the ngx_http_autoindex_module returned the 500 error if the broken symlink was in a directory. *) Bugfix: the files bigger than 4G could not be transferred using sendfile. *) Bugfix: if the backend was resolved to several backends and there was an error while the response waiting then process may got caught in an endless loop. *) Bugfix: the worker process may exit with the "unknown cycle" message when the /dev/poll method was used. *) Bugfix: "close() channel failed" errors. *) Bugfix: the autodetection of the "nobody" and "nogroup" groups. *) Bugfix: the send_lowat directive did not work on Linux. *) Bugfix: the segmentation fault occurred if there was no events section in configuration. *) Bugfix: nginx could not be built on OpenBSD. *) Bugfix: the double slashes in "://" in the URI were converted to ":/".
2004-11-25nginx-0.1.9-RELEASE importrelease-0.1.9Igor Sysoev1-1/+1
*) Bugfix: the proxied request was sent without arguments if the request contains "//", "/./", "/../" or "%XX". *) Bugfix: the large compressed responses may be transferred not completely. *) Bugfix: the files bigger than 2G was not transferred on Linux that does not support sendfile64(). *) Bugfix: while the build configuration on Linux the --with-poll_module parameter was required; the bug had appeared in 0.1.8.
2004-11-11nginx-0.1.5-RELEASE importrelease-0.1.5Igor Sysoev1-2/+2
*) Bugfix: on Solaris and Linux there may be too many "recvmsg() returned not enough data" alerts. *) Bugfix: there were the "writev() failed (22: Invalid argument)" errors on Solaris in proxy mode without sendfile. On other platforms that do not support sendfile at all the process got caught in an endless loop. *) Bugfix: segmentation fault on Solaris in proxy mode and using sendfile. *) Bugfix: segmentation fault on Solaris. *) Bugfix: on-line upgrade did not work on Linux. *) Bugfix: the ngx_http_autoindex_module module did not escape the spaces, the quotes, and the percent signs in the directory listing. *) Change: the decrease of the copy operations. *) Feature: the userid_p3p directive.
2004-10-21nginx-0.1.2-RELEASE importrelease-0.1.2Igor Sysoev1-2/+2
*) Feature: the --user=USER, --group=GROUP, and --with-ld-opt=OPTIONS options in configure. *) Feature: the server_name directive supports *.domain.tld. *) Bugfix: the portability improvements. *) Bugfix: if configuration file was set in command line, the reconfiguration was impossible; the bug had appeared in 0.1.1. *) Bugfix: proxy module may get caught in an endless loop when sendfile is not used. *) Bugfix: with sendfile the response was not recoded according to the charset module directives; the bug had appeared in 0.1.1. *) Bugfix: very seldom bug in the kqueue processing. *) Bugfix: the gzip module compressed the proxied responses that was already compressed.
2004-09-29nginx-0.1.0-2004-09-29-20:00:49 import; remove years from copyrightIgor Sysoev1-1/+1
2004-09-28nginx-0.1.0-2004-09-28-12:34:51 import; set copyright and remove unused filesIgor Sysoev1-1/+1
2004-09-16nginx-0.0.11-2004-09-16-20:10:13 importIgor Sysoev1-4/+14
2004-07-28nginx-0.0.9-2004-07-28-20:16:50 importIgor Sysoev1-1/+0
2004-06-21nginx-0.0.7-2004-06-21-19:59:32 importIgor Sysoev1-39/+66
2004-06-01nginx-0.0.3-2004-06-01-10:04:46 importIgor Sysoev1-29/+30
2004-05-28nginx-0.0.3-2004-05-28-19:49:23 import; rename ngx_hunk_t to ngx_buf_tIgor Sysoev1-3/+3
2004-03-16nginx-0.0.2-2004-03-16-10:10:12 importIgor Sysoev1-2/+2
2004-02-29nginx-0.0.2-2004-03-01-00:03:02 importIgor Sysoev1-0/+5
2004-02-18nginx-0.0.2-2004-02-18-18:45:21 importIgor Sysoev1-1/+1
2004-02-09nginx-0.0.2-2004-02-09-10:46:43 importIgor Sysoev1-31/+42
2004-02-01nginx-0.0.1-2004-02-01-11:10:52 importIgor Sysoev1-1/+1
2004-01-05nginx-0.0.1-2004-01-05-23:55:48 importIgor Sysoev1-3/+3
2003-11-30nginx-0.0.1-2003-11-30-23:03:18 importIgor Sysoev1-4/+3