summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-09-22Style.Maxim Dounin1-1/+2
2015-09-15Increased the default number of output buffers.Valentin Bartenev1-1/+1
Since an output buffer can only be used for either reading or sending, small amounts of data left from the previous operation (due to some limits) must be sent before nginx will be able to read further into the buffer. Using only one output buffer can result in suboptimal behavior that manifests itself in forming and sending too small chunks of data. This is particularly painful with SPDY (or HTTP/2) where each such chunk needs to be prefixed with some header. The default flow-control window in HTTP/2 is 64k minus one bytes. With one 32k output buffer this results is one byte left after exhausting the window. With two 32k buffers the data will be read into the second free buffer before sending, thus the minimum output is increased to 32k + 1 bytes which is much better.
2015-09-22HTTP/2: fixed header block parsing with CONTINUATION frames (#792).Valentin Bartenev2-70/+136
It appears that the CONTINUATION frames don't need to be aligned to bounds of individual headers.
2015-09-22HTTP/2: fixed HPACK header field parsing.Valentin Bartenev1-0/+5
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 Bartenev22-5681/+9226
The SPDY support is removed, as it's incompatible with the new module.
2015-09-11Core: fixed segfault with null in wildcard hash names.Maxim Dounin1-0/+4
A configuration like server { server_name .foo^@; } server { server_name .foo; } resulted in a segmentation fault during construction of server names hash. Reported by Markus Linnala. Found with afl-fuzz.
2015-09-11Fixed segfault with incorrect location nesting.Maxim Dounin2-2/+2
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-09-11Cache: check the whole cache key in addition to hashes.Maxim Dounin1-2/+19
This prevents a potential attack that discloses cached data if an attacker will be able to craft a hash collision between some cache key the attacker is allowed to access and another cache key with protected data. See http://mailman.nginx.org/pipermail/nginx-devel/2015-September/007288.html. Thanks to Gena Makhomed and Sergey Brester.
2015-09-03Upstream: fixed cache send error handling.Roman Arutyunyan1-11/+14
The value of NGX_ERROR, returned from filter handlers, was treated as a generic upstream error and changed to NGX_HTTP_INTERNAL_SERVER_ERROR before calling ngx_http_finalize_request(). This resulted in "header already sent" alert if header was already sent in filter handlers. The problem appeared in 54e9b83d00f0 (1.7.5).
2015-09-02Fixed building --with-debug, broken by 6fce16b1fc10.Valentin Bartenev1-1/+1
2015-09-02Writing to some file systems can be interrupted.Valentin Bartenev1-1/+12
At least such behavior was observed with CephFS, see: http://mailman.nginx.org/pipermail/nginx/2015-July/048188.html.
2015-08-31Decreased the NGX_HTTP_MAX_SUBREQUESTS limit.Valentin Bartenev1-1/+1
There is no much sense in such a big value since its semantics has been changed in 06e850859a26 to limit recursive subrequests.
2015-08-31Added protection against r->main->count overflow by subrequests.Valentin Bartenev2-1/+11
This overflow has become possible after the change in 06e850859a26, since concurrent subrequests are not limited now and each of them is counted in r->main->count.
2015-08-23Limit recursive subrequests instead of simultaneous.Valentin Bartenev2-5/+2
2015-08-23Version bump.Valentin Bartenev1-2/+2
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 Dounin7-17/+19
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-16Fixed wrong URI after try_files in nested location (ticket #97).Maxim Dounin1-3/+5
The following configuration with alias, nested location and try_files resulted in wrong file being used. Request "/foo/test.gif" tried to use "/tmp//foo/test.gif" instead of "/tmp/test.gif": location /foo/ { alias /tmp/; location ~ gif { try_files $uri =405; } } Additionally, rev. c985d90a8d1f introduced a regression if the "/tmp//foo/test.gif" file was found (ticket #768). Resulting URI was set to "gif?/foo/test.gif", as the code used clcf->name of current location ("location ~ gif") instead of parent one ("location /foo/"). Fix is to use r->uri instead of clcf->name in all cases in the ngx_http_core_try_files_phase() function. It is expected to be already matched and identical to the clcf->name of the right location.
2015-08-16Fixed segfault with try_files introduced by c985d90a8d1f.Maxim Dounin1-1/+3
If alias was used in a location given by a regular expression, nginx used to do wrong thing in try_files if a location name (i.e., regular expression) was an exact prefix of URI. The following configuration triggered a segmentation fault on a request to "/mail": location ~ /mail { alias /path/to/directory; try_files $uri =404; } Reported by Per Hansson.
2015-08-13Core: fixed potential division by zero when initializing hash.Sergey Kandaurov1-0/+8
Found by Clang Static Analyzer.
2015-08-13Core: fixed style in the error message.Sergey Kandaurov1-1/+1
2015-08-13Stream: fixed potential error log buffer overrun.Vladimir Homutov1-1/+3
Found by Duan Jiong <djduanjiong@gmail.com>.
2015-08-12Style.Vladimir Homutov1-1/+1
2015-08-10Stream: the "tcp_nodelay" directive.Vladimir Homutov4-2/+52
2015-08-11Core: idle connections now closed only once on exiting.Valentin Bartenev5-35/+31
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-08-11Fixed typo in the error message.Andrei Belov1-1/+1
2015-07-23Workaround for "configuration file test failed" under OpenVZ.Gena Makhomed1-4/+22
If nginx was used under OpenVZ and a container with nginx was suspended and resumed, configuration tests started to fail because of EADDRINUSE returned from listen() instead of bind(): # nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: [emerg] listen() to 0.0.0.0:80, backlog 511 failed (98: Address already in use) nginx: configuration file /etc/nginx/nginx.conf test failed With this change EADDRINUSE errors returned by listen() are handled similarly to errors returned by bind(), and configuration tests work fine in the same environment: # nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/nginx.conf test is successful More details about OpenVZ suspend/resume bug: https://bugzilla.openvz.org/show_bug.cgi?id=2470
2015-07-30Stream: deprecated proxy_downstream_buffer, proxy_upstream_buffer.Roman Arutyunyan1-0/+23
The directive proxy_buffer_size should be used instead.
2015-07-29Style.Roman Arutyunyan1-2/+1
2015-07-29Stream: added proxy_buffer_size to set the size of data buffers.Roman Arutyunyan1-23/+11
Both download and upload buffers now have the same size. The old directives proxy_downstream_buffer and proxy_upstream_buffer are removed.
2015-07-16Fixed strict aliasing warnings with old GCC versions.Ruslan Ermilov2-2/+2
2015-07-15Version bump.Maxim Dounin1-2/+2
2015-07-14Stream: renamed rate limiting directives.Roman Arutyunyan1-14/+14
The directive proxy_downstream_limit_rate is now called proxy_upload_rate. The directive proxy_upstream_limit_rate is now called proxy_download_rate.
2015-07-14OCSP stapling: fixed segfault without nextUpdate.Maxim Dounin1-5/+10
OCSP responses may contain no nextUpdate. As per RFC 6960, this means that nextUpdate checks should be bypassed. Handle this gracefully by using NGX_MAX_TIME_T_VALUE as "valid" in such a case. The problem was introduced by 6893a1007a7c (1.9.2). Reported by Matthew Baldwin.
2015-07-07OCSP stapling: fixed ssl_stapling_file (ticket #769).Maxim Dounin1-0/+1
Broken by 6893a1007a7c (1.9.2) during introduction of strict OCSP response validity checks. As stapling file is expected to be returned unconditionally, fix is to set its validity to the maximum supported time. Reported by Faidon Liambotis.
2015-07-02Stream: fixed possible integer overflow in rate limiting.Valentin Bartenev1-1/+1
2015-07-02Stream: fixed MSVC compilation warning.Roman Arutyunyan1-1/+1
Thanks to itpp2012.
2015-06-25Stream: upstream "connected" flag.Roman Arutyunyan2-5/+7
Once upstream is connected, the upstream buffer is allocated. Previously, the proxy module used the buffer allocation status to check if upstream is connected. Now it's enough to check the flag.
2015-06-23Stream: upstream and downstream limit rates.Roman Arutyunyan2-15/+111
2015-06-23Stream: common handler for upstream and downstream.Roman Arutyunyan1-25/+18
2015-06-18Stream: avoid SSL_CTX_set_tmp_rsa_callback() call with LibreSSL.Piotr Sikora1-0/+2
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2015-06-16Upstream: fixed shared upstreams on win32.Ruslan Ermilov4-24/+64
2015-06-18Stream: connection limiting module.Vladimir Homutov3-0/+642
stream { limit_conn_zone $binary_remote_addr zone=perip:1m; limit_conn_log_level error; server { ... limit_conn perip 1; } }
2015-06-17Resolver: canceled resend timer on empty resend queues.Sergey Kandaurov1-0/+20
This is specifically useful on graceful shutdown.
2015-06-16Disabled duplicate http, mail, and stream blocks.Vladimir Homutov3-0/+12
Such configurations have very limited use, introduce various problems and are not officially supported.
2015-06-16Version bump.Vladimir Homutov1-2/+2