summaryrefslogtreecommitdiffhomepage
path: root/src/http/modules (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2016-10-03Addition filter: set last_in_chain flag when clearing last_buf.Roman Arutyunyan1-0/+1
When the last_buf flag is cleared for add_after_body to append more data from a subrequest, other filters may still have buffered data, which should be flushed at this point. For example, the sub_filter may have a partial match buffered, which will only be flushed after the subrequest is done, ending up with interleaved data in output. Setting last_in_chain instead of last_buf flushes the data and fixes the order of output buffers.
2016-07-02Sub filter: eliminate unnecessary buffering.Roman Arutyunyan1-4/+37
Previously, when a buffer was processed by the sub filter, its final bytes could be buffered by the filter even if they don't match any pattern. This happened because the Boyer-Moore algorithm, employed by the sub filter since b9447fc457b4 (1.9.4), matches the last characters of patterns prior to checking other characters. If the last character is out of scope, initial bytes of a potential match are buffered until the last character is available. Now, after receiving a flush or recycled buffer, the filter performs additional checks to reduce the number of buffered bytes. The potential match is checked against the initial parts of all patterns. Non-matching bytes are not buffered. This improves processing of a chunked response from upstream by sending the entire chunks without buffering unless a partial match is found at the end of a chunk.
2016-07-02Sub filter: introduced the ngx_http_sub_match() function.Roman Arutyunyan1-31/+52
No functional changes.
2016-04-11FastCGI: skip special bufs in buffered request body chain.Valentin Bartenev1-0/+5
This prevents forming empty records out of such buffers. Particularly it fixes double end-of-stream records with chunked transfer encoding, or when HTTP/2 is used and the END_STREAM flag has been sent without data. In both cases there is an empty buffer at the end of the request body chain with the "last_buf" flag set. The canonical libfcgi, as well as php implementation, tolerates such records, while the HHVM parser is more strict and drops the connection (ticket #950).
2016-04-11Fixed typos.Alessandro Ghedini1-2/+2
2016-04-07Fixed spelling.Josh Soref2-5/+5
2016-03-31SSL: RSA_generate_key() is deprecated in OpenSSL 1.1.0.Maxim Dounin1-1/+1
OpenSSL removed support for all 40 and 56 bit ciphers.
2016-03-31Fixed logging.Sergey Kandaurov14-25/+25
2016-03-31Fixed logging with variable field width.Sergey Kandaurov2-4/+5
2016-03-31Fixed logging in close error handling.Sergey Kandaurov1-1/+1
2016-03-30Style.Ruslan Ermilov11-28/+28
2016-03-28Upstream: proxy_next_upstream non_idempotent.Maxim Dounin4-0/+4
By default, requests with non-idempotent methods (POST, LOCK, PATCH) are no longer retried in case of errors if a request was already sent to a backend. Previous behaviour can be restored by using "proxy_next_upstream ... non_idempotent".
2016-03-28Sub filter: fixed allocation alignment.Roman Arutyunyan1-4/+4
2016-02-18Headers filter: fixed "add_header ... '' always".Ruslan Ermilov1-8/+8
The "always" parameter was ignored if the header value was empty.
2016-02-04Dynamic modules: changed ngx_modules to cycle->modules.Maxim Dounin1-4/+4
2015-12-17Upstream: don't keep connections on early responses (ticket #669).Maxim Dounin1-0/+4
2015-12-08Slice filter: terminate first slice with last_in_chain flag.Roman Arutyunyan1-0/+1
This flag makes sub filter flush buffered data and optimizes allocation in copy filter.
2015-12-08Slice filter: never run subrequests when main request is buffered.Roman Arutyunyan1-0/+4
With main request buffered, it's possible, that a slice subrequest will send output before it. For example, while main request is waiting for aio read to complete, a slice subrequest can start an aio operation as well. The order in which aio callbacks are called is undetermined.
2015-12-07Slice filter.Roman Arutyunyan2-5/+544
Splits a request into subrequests, each providing a specific range of response. The variable "$slice_range" must be used to set subrequest range and proper cache key. The directive "slice" sets slice size. The following example splits requests into 1-megabyte cacheable subrequests. server { listen 8000; location / { slice 1m; proxy_cache cache; proxy_cache_key $uri$is_args$args$slice_range; proxy_set_header Range $slice_range; proxy_cache_valid 200 206 1h; proxy_pass http://127.0.0.1:9000; } }
2015-11-06Proxy: improved code readability.Ruslan Ermilov1-12/+5
Do not assume that space character follows the method name, just pass it explicitly. The fuss around it has already proved to be unsafe, see bbdb172f0927 and http://mailman.nginx.org/pipermail/nginx-ru/2013-January/049692.html for details.
2015-11-06Style: unified request method checks.Ruslan Ermilov3-3/+3
2015-11-21Upstream: fixed "no port" detection in evaluated upstreams.Ruslan Ermilov4-8/+12
If an upstream with variables evaluated to address without a port, then instead of a "no port in upstream" error an attempt was made to connect() which failed with EADDRNOTAVAIL.
2015-11-16Realip: the $realip_remote_addr variable.Ruslan Ermilov1-1/+71
2015-11-11Upstream: proxy_cache_convert_head directive.Roman Arutyunyan1-0/+11
The directive toggles conversion of HEAD to GET for cacheable proxy requests. When disabled, $request_method must be added to cache key for consistency. By default, HEAD is converted to GET as before.
2015-09-21Sub filter: fixed initialization in http{} level (ticket #791).Roman Arutyunyan1-1/+2
If sub_filter directive was only specified at http{} level, sub filter internal data remained uninitialized. That would lead to a crash in runtime.
2015-09-11The HTTP/2 implementation (RFC 7240, 7241).Valentin Bartenev1-11/+13
The SPDY support is removed, as it's incompatible with the new module.
2015-09-11Fixed segfault with incorrect location nesting.Maxim Dounin1-1/+1
A configuration with a named location inside a zero-length prefix or regex location used to trigger a segmentation fault, as ngx_http_core_location() failed to properly detect if a nested location was created. Example configuration to reproduce the problem: location "" { location @foo {} } Fix is to not rely on a parent location name length, but rather check command type we are currently parsing. Identical fix is also applied to ngx_http_rewrite_if(), which used to incorrectly assume the "if" directive is on server{} level in such locations. Reported by Markus Linnala. Found with afl-fuzz.
2015-08-18Perl: prototyping behavior explicitly specified.Maxim Dounin1-0/+3
When prototyping behavior is not explicitly specified, xsubpp emits a message to stderr asking to do so (see ticket #608).
2015-08-18Perl: fixed warning about "sep" may be used uninitialized.Maxim Dounin1-9/+6
2015-08-17Win32: MSVC 2015 compatibility.Maxim Dounin2-6/+5
Resolved warnings about declarations that hide previous local declarations. Warnings about WSASocketA() being deprecated resolved by explicit use of WSASocketW() instead of WSASocket(). When compiling without IPv6 support, WinSock deprecated warnings are disabled to allow use of gethostbyname().
2015-08-17Sub filter: support of variables in the strings to replace.Dmitry Volyntsev1-28/+146
2015-08-17Sub filter: support of multiple strings to replace.Dmitry Volyntsev1-166/+247
2015-08-11Core: idle connections now closed only once on exiting.Valentin Bartenev1-0/+4
Iterating through all connections takes a lot of CPU time, especially with large number of worker connections configured. As a result nginx processes used to consume CPU time during graceful shutdown. To mitigate this we now only do a full scan for idle connections when shutdown signal is received. Transitions of connections to idle ones are now expected to be avoided if the ngx_exiting flag is set. The upstream keepalive module was modified to follow this.
2015-07-16Fixed strict aliasing warnings with old GCC versions.Ruslan Ermilov1-1/+1
2015-06-16Upstream: fixed shared upstreams on win32.Ruslan Ermilov1-12/+31
2015-06-11Moved ngx_http_parse_time() to core, renamed accordingly.Maxim Dounin4-5/+5
The function is now called ngx_parse_http_time(), and can be used by any code to parse HTTP-style date and time. In particular, it will be used for OCSP stapling. For compatibility, a macro to map ngx_http_parse_time() to the new name provided for a while.
2015-06-04Upstream keepalive: reduced diffs to the plus version of nginx.Roman Arutyunyan1-39/+42
2015-05-25Disabled SSLv3 by default (ticket #653).Maxim Dounin3-7/+5
2015-05-18Upstream hash: consistency across little/big endianness.Sergey Kandaurov1-4/+15
2015-04-22Upstream: allow multiple upstreams to use the same shared zone.Ruslan Ermilov1-42/+56
2015-04-21Memcached: enabled ranges.Martin Mlynář1-0/+1
2015-04-21Upstream: simplified ip_hash and hash peer selection code.Ruslan Ermilov2-44/+16
Now that peers are stored as a list, the weighted and unweighted cases became nearly identical.
2015-04-20Limit req: removed check for unknown limit_req_zone.Sergey Kandaurov1-7/+0
With 48b3d5ddfb03, it's possible to specify limit_req_zone after limit_req.
2015-04-16Upstream: get rid of questionable micro-optimization in ip_hash.Ruslan Ermilov1-7/+2
If a peer was initially skipped due to max_fails, there's no reason not to try it again if enough time has passed, and the next_upstream logic is in action. This also reduces diffs with NGINX Plus.
2015-04-14Upstream: the "zone" directive.Ruslan Ermilov1-0/+213
Upstreams with the "zone" directive are kept in shared memory, with a consistent view of all worker processes.
2015-04-14Upstreams: locking.Ruslan Ermilov3-6/+31
2015-04-10Upstream: store peers as a linked list.Ruslan Ermilov3-46/+62
This is an API change.
2015-04-10Upstream: track the number of active connections to upstreams.Ruslan Ermilov3-120/+24
This also simplifies the implementation of the least_conn module.
2015-03-31Fixed invalid access to complex value defined as an empty string.Sergey Kandaurov1-3/+3
Found by Valgrind.
2015-03-26Proxy: fixed proxy_request_buffering and chunked with preread body.Maxim Dounin1-3/+4
If any preread body bytes were sent in the first chain, chunk size was incorrectly added before the whole chain, including header, resulting in an invalid request sent to upstream. Fixed to properly add chunk size after the header.