summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)AuthorFilesLines
2017-06-14Removed excessive casts for ngx_file_info().Ruslan Ermilov2-6/+2
2017-06-06Configure: use .exe for binaries for all win32 compilers.Orgad Shaneh4-3/+1
2017-06-06Configure: fix compilation on MSYS2 / MinGW64.Orgad Shaneh1-1/+1
2017-06-13HTTP/2: reject HTTP/2 requests without ":scheme" pseudo-header.Piotr Sikora1-0/+1
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-06-07Userid: ngx_http_get_indexed_variable() error handling.Sergey Kandaurov1-0/+4
When evaluating a mapped $reset_uid variable in the userid filter, if get_handler set to ngx_http_map_variable() returned an error, this previously resulted in a NULL pointer dereference.
2017-06-07Fixed segfault in try_files with nested location.Sergey Kandaurov1-0/+1
If memory allocation of a new r->uri.data storage failed, reset its length as well. Request URI is used in ngx_http_finalize_request() for debug logging.
2017-06-07SSI: return NGX_ERROR when timefmt memory allocation failed.Sergey Kandaurov1-1/+1
Previously, when using NGX_HTTP_SSI_ERROR, error was ignored in ssi processing, thus timefmt could be accessed later in ngx_http_ssi_date_gmt_local_variable() as part of "set" handler, or NULL format pointer could be passed to strftime().
2017-06-02HTTP/2: don't send SETTINGS ACK before already queued DATA frames.Piotr Sikora2-1/+10
Previously, SETTINGS ACK was sent immediately upon receipt of SETTINGS frame, before already queued DATA frames created using old SETTINGS. This incorrect behavior was source of interoperability issues, because peers rely on the fact that new SETTINGS are in effect after receiving SETTINGS ACK. Reported by Feng Li. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-06-02HTTP/2: make SETTINGS ACK frame reusable.Piotr Sikora1-25/+31
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-06-02HTTP/2: send SETTINGS ACK after applying all SETTINGS params.Piotr Sikora1-2/+2
This avoids sending unnecessary SETTINGS ACK in case of PROTOCOL_ERROR. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-06-02HTTP/2: emit new frames only after applying all SETTINGS params.Piotr Sikora1-6/+11
Previously, new frames could be emitted in the middle of applying new (and already acknowledged) SETTINGS params, which is illegal. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-06-02Configure: enabled rpath for NetBSD.Sergey Kandaurov1-0/+8
2017-06-01Configure: disabled IP_PKTINFO feature on certain platforms.Roman Arutyunyan1-1/+4
On Cygwin and NetBSD 7.0+ struct in_pktinfo has no ipi_spec_dst field, which caused nginx compilation error. Now presence of this field is ensured by the IP_PKTINFO feature test. The problem was introduced by dbb0c854e308 (1.13.0).
2017-06-01Style.Maxim Dounin1-3/+3
2017-05-31Upstream: style.Piotr Sikora1-1/+1
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-05-31Headers filter: style.Piotr Sikora1-2/+2
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-05-30HTTP/2: add debug logging of pseudo-headers and cookies.Piotr Sikora1-20/+28
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2017-05-30Version bump.Valentin Bartenev1-2/+2
2017-05-30release-1.13.1 tagMaxim Dounin1-0/+1
2017-05-30nginx-1.13.1-RELEASErelease-1.13.1Maxim Dounin1-0/+98
2017-05-30Updated OpenSSL used for win32 builds.Maxim Dounin1-1/+1
2017-05-29Fixed background requests with asynchronous operations.Roman Arutyunyan1-5/+3
If the main request was finalized while a background request performed an asynchronous operation, the main request ended up in ngx_http_writer() and was not finalized until a network event or a timeout. For example, cache background update with aio enabled made nginx unable to process further client requests or close the connection, keeping it open until client closes it. Now regular finalization of the main request is not suspended because of an asynchronous operation in another request. If a background request was terminated while an asynchronous operation was in progress, background request's write event handler was changed to ngx_http_request_finalizer() and never called again. Now, whenever a request is terminated while an asynchronous operation is in progress, connection error flag is set to make further finalizations of any request with this connection lead to termination. These issues appeared in 1aeaae6e9446 (not yet released).
2017-05-29Configure: sched_setaffinity() test moved to auto/unix.Maxim Dounin2-14/+12
The sched_setaffinity() function was introduced in DragonFly BSD 4.7, so it is no longer Linux-specific. Prodded by Sepherosa Ziehau.
2017-05-29Style: changed checks of ngx_ssl_create_connection() to != NGX_OK.Maxim Dounin2-2/+2
In http these checks were changed in a6d6d762c554, though mail module was missed at that time. Since then, the stream module was introduced based on mail, using "== NGX_ERROR" check.
2017-05-29SSL: set TCP_NODELAY on SSL connections before handshake.Maxim Dounin2-11/+27
With OpenSSL 1.1.0+, the workaround for handshake buffer size as introduced in a720f0b0e083 (ticket #413) no longer works, as OpenSSL no longer exposes handshake buffers, see https://github.com/openssl/openssl/commit/2e7dc7cd688. Moreover, it is no longer possible to adjust handshake buffers at all now. To avoid additional RTT if handshake uses more than 4k we now set TCP_NODELAY on SSL connections before handshake. While this still results in sub-optimal network utilization due to incomplete packets being sent, it seems to be better than nothing.
2017-05-26Introduced ngx_tcp_nodelay().Ruslan Ermilov7-155/+69
2017-05-25Background subrequests for cache updates.Roman Arutyunyan4-24/+49
Previously, cache background update might not work as expected, making client wait for it to complete before receiving the final part of a stale response. This could happen if the response could not be sent to the client socket in one filter chain call. Now background cache update is done in a background subrequest. This type of subrequest does not block any other subrequests or the main request.
2017-05-24Fixed deferred accept with EPOLLRDHUP enabled (ticket #1278).Roman Arutyunyan1-1/+1
Previously, the read event of the accepted connection was marked ready, but not available. This made EPOLLRDHUP-related code (for example, in ngx_unix_recv()) expect more data from the socket, leading to unexpected behavior. For example, if SSL, PROXY protocol and deferred accept were enabled on a listen socket, the client connection was aborted due to unexpected return value of c->recv().
2017-05-23HTTP/2: fixed segfault when memory allocation failed.Valentin Bartenev1-2/+2
If allocation of cleanup handler in the HTTP/2 header filter failed, then a stream might be freed with a HEADERS frame left in the output queue. Now the HEADERS frame is accounted in the queue before trying to allocate the cleanup handler.
2017-05-22Contrib: proper syntax parsing in vim syntax highlighting.Maxim Dounin1-1711/+1741
Instead of highlighting directives in arbitrary positions, proper parsing of nginx.conf syntax was implemented, matching what nginx does internally. This allows vim to correctly highlight various complex cases, including: return 301 http://example.com/path#fragment"; and also avoids highlighting of parameters as directives, as in server_name missing.semicolon.example.com index index.php; where "index" is not a directive but a parameter of the "server_name" directive due to missing semicolon. Most important downside of this approach seems to be that there is no easy way to introduce directive-specific parameters. As such, only "listen" directive parameters were preserved.
2017-05-18Cache: ignore long locked entries during forced expire.Dmitry Volyntsev1-11/+42
Abnormally exited workers may leave locked cache entries, this can result in the cache size on disk exceeding max_size and shared memory exhaustion. This change mitigates the issue by ignoring locked entries during forced expire. It also increases the visibility of the problem by logging such entries.
2017-05-18Upstream: fixed u->headers_in.headers allocation error handling.Sergey Kandaurov4-0/+6
Previously, an allocation error resulted in uninitialized memory access when evaluating $upstream_http_ variables. On a related note, see r->headers_out.headers cleanup work in 0cdee26605f3.
2017-05-15Configure: recent Sun C versions.Maxim Dounin1-1/+4
2017-05-15Configure: disabled gcc atomics with Sun C (ticket #1261).Maxim Dounin1-15/+19
Oracle Developer Studio 12.5 introduced GCC-compatible __sync builtins. Unfortunately, these builtins are neither GCC-compatible (they generate warnings when used with volatile), nor working (unexpectedly fail on unpredictable combinations of code layout and compiler flags). As such, the gcc builtin atomic operations configure test explicitly disabled when compiling with Sun C.
2017-05-15Configure: style.Maxim Dounin1-1/+1
2017-05-15Realip: allow hostnames in set_real_ip_from (ticket #1180).Ruslan Ermilov2-30/+136
2017-05-15Access: simplified rule parser code.Ruslan Ermilov2-26/+14
2017-05-03SSL: allowed renegotiation in client mode with OpenSSL < 1.1.0.Sergey Kandaurov1-1/+1
In ac9b1df5b246 (1.13.0) we attempted to allow renegotiation in client mode, but when using OpenSSL 1.0.2 or older versions it was additionally disabled by SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS.
2017-04-27Added missing "fall through" comments (ticket #1259).Maxim Dounin3-0/+6
Found by gcc7 (-Wimplicit-fallthrough).
2017-04-25Don't pretend we support HTTP major versions >1 as HTTP/1.1.Ruslan Ermilov5-8/+34
2017-04-25Version bump.Ruslan Ermilov1-2/+2
2017-04-25release-1.13.0 tagMaxim Dounin1-0/+1
2017-04-25nginx-1.13.0-RELEASErelease-1.13.0Maxim Dounin1-0/+78
2017-04-24HTTP/2: reduced difference to HTTP/1.x in reading request body.Valentin Bartenev3-33/+18
Particularly, this eliminates difference in behavior for requests without body and deduplicates code. Prodded by Piotr Sikora.
2017-04-24HTTP/2: rejecting zero WINDOW_UPDATE with PROTOCOL_ERROR.Valentin Bartenev1-0/+38
It's required by RFC 7540. While there is no real harm from such frames, that should help to detect broken clients. Based on a patch by Piotr Sikora.
2017-04-20Gzip static: use an appropriate error on memory allocation failure.Sergey Kandaurov1-1/+1
2017-04-20Cleaned up r->headers_out.headers allocation error handling.Sergey Kandaurov8-15/+28
If initialization of a header failed for some reason after ngx_list_push(), leaving the header as is can result in uninitialized memory access by the header filter or the log module. The fix is to clear partially initialized headers in case of errors. For the Cache-Control header, the fix is to postpone pushing r->headers_out.cache_control until its value is completed.
2017-04-20Core: signal sender pid logging.Igor Sysoev1-8/+24
2017-04-18Sub filter: restored ngx_http_set_ctx() at the proper place.Sergey Kandaurov1-2/+2
Previously, ngx_http_sub_header_filter() could fail with a partially initialized context, later accessed in ngx_http_sub_body_filter() if called from the perl content handler. The issue had appeared in 2c045e5b8291 (1.9.4). A better fix would be to handle ngx_http_send_header() errors in the perl module, though this doesn't seem to be easy enough.
2017-04-18SSL: compatibility with OpenSSL master branch.Sergey Kandaurov1-1/+1
The SSL_CTRL_SET_CURVES_LIST macro is removed in the OpenSSL master branch. SSL_CTX_set1_curves_list is preserved as compatibility with previous versions.