summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-12-09Version bump.Ruslan Ermilov1-2/+2
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-08SSL: fixed possible segfault on renegotiation (ticket #845).Sergey Kandaurov1-0/+4
Skip SSL_CTX_set_tlsext_servername_callback in case of renegotiation. Do nothing in SNI callback as in this case it will be supplied with request in c->data which isn't expected and doesn't work this way. This was broken by b40af2fd1c16 (1.9.6) with OpenSSL master branch and LibreSSL.
2015-12-07Slice filter.Roman Arutyunyan3-5/+546
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-12-07Upstream: fill r->headers_out.content_range from upstream response.Roman Arutyunyan1-0/+5
2015-12-02Core: fix typo in error message.Piotr Sikora1-1/+1
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2015-12-03Style: NGX_PTR_SIZE replaced with sizeof(void *).Maxim Dounin2-2/+2
The NGX_PTR_SIZE macro is only needed in preprocessor directives where it's not possible to use sizeof().
2015-12-02Style.Maxim Dounin1-1/+1
2015-11-30Stop emulating a space character after r->method_name.Ruslan Ermilov2-4/+1
This is an API change. The proxy module was modified to not depend on this in 44122bddd9a1. No known third-party modules seem to depend on this.
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-30Reduced the number of GET method constants.Ruslan Ermilov1-4/+1
2015-11-30Increased the default "connection_pool_size" on 64-bit platforms.Valentin Bartenev1-1/+1
The previous default of 256 bytes isn't enough and results in two allocations on each accepted connection, which is suboptimal.
2015-11-06Style: unified request method checks.Ruslan Ermilov5-5/+5
2015-11-23Core: enabled "include" inside http upstreams (ticket #635).Ruslan Ermilov1-1/+1
The directive already works inside stream upstream blocks.
2015-11-21Upstream: fixed "no port" detection in evaluated upstreams.Ruslan Ermilov5-10/+22
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-17Used the pwritev() syscall for writing files where possible.Valentin Bartenev1-3/+35
It is more effective, because it doesn't require a separate lseek().
2015-11-17Moved file writev() handling code to a separate function.Valentin Bartenev1-32/+51
No functional changes.
2015-11-17Handled EINTR from write() and pwrite() syscalls.Valentin Bartenev1-3/+20
This is in addition to 6fce16b1fc10.
2015-11-17Adjusted file->sys_offset after the write() syscall.Valentin Bartenev1-0/+1
This fixes suboptimal behavior caused by surplus lseek() for sequential writes on systems without pwrite(). A consecutive read after write might result in an error on systems without pread() and pwrite(). Fortunately, at the moment there are no widely used systems without these syscalls.
2015-11-17Version bump.Valentin Bartenev1-2/+2
2015-11-16Realip: the $realip_remote_addr variable.Ruslan Ermilov1-1/+71
2015-11-13HTTP/2: reused HEADERS and CONTINUATION frames buffers.Valentin Bartenev2-10/+21
2015-11-13HTTP/2: fixed handling of output HEADERS frames.Valentin Bartenev1-6/+19
The HEADERS frame is always represented by more than one buffer since b930e598a199, but the handling code hasn't been adjusted. Only the first buffer of HEADERS frame was checked and if it had been sent while others had not, the rest of the frame was dropped, resulting in broken connection. Before b930e598a199, the problem could only be seen in case of HEADERS frame with CONTINUATION.
2015-11-13HTTP/2: fixed invalid headers handling (ticket #831).Valentin Bartenev1-0/+2
The r->invalid_header flag wasn't reset once an invalid header appeared in a request, resulting in all subsequent headers in the request were also marked as invalid.
2015-11-11Upstream: proxy_cache_convert_head directive.Roman Arutyunyan3-1/+13
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-11-05SSL: only select HTTP/2 using NPN if "http2" is enabled.Valentin Bartenev1-10/+16
OpenSSL doesn't check if the negotiated protocol has been announced. As a result, the client might force using HTTP/2 even if it wasn't enabled in configuration.
2015-11-05HTTP/2: backed out 16905ecbb49e (ticket #822).Valentin Bartenev1-3/+5
It caused inconsistency between setting "in_closed" flag and the moment when the last DATA frame was actually read. As a result, the body buffer might not be initialized properly in ngx_http_v2_init_request_body(), which led to a segmentation fault in ngx_http_v2_state_read_data(). Also it might cause start processing of incomplete body. This issue could be triggered when the processing of a request was delayed, e.g. in the limit_req or auth_request modules.
2015-10-30Fixed ngx_parse_time() out of bounds access (ticket #821).Maxim Dounin1-1/+1
The code failed to ensure that "s" is within the buffer passed for parsing when checking for "ms", and this resulted in unexpected errors when parsing non-null-terminated strings with trailing "m". The bug manifested itself when the expires directive was used with variables. Found by Roman Arutyunyan.
2015-10-26Syslog: added "nohostname" option.Vladimir Homutov2-1/+10
The option disables sending hostname in the syslog message header. This is useful with syslog daemons that do not expect it (tickets #677 and #783).
2015-10-27HTTP/2: changed behavior of the "http2_max_field_size" directive.Valentin Bartenev2-21/+13
Now it limits only the maximum length of literal string (either raw or compressed) in HPACK request header fields. It's easier to understand and to describe in the documentation.
2015-10-27HTTP/2: fixed spelling.Valentin Bartenev1-2/+2
2015-10-27Version bump.Valentin Bartenev1-2/+2
2015-10-26HTTP/2: simplified checking the END_STREAM flag.Valentin Bartenev1-5/+3
No functional changes.
2015-10-26HTTP/2: improved the ngx_http_v2_integer_octets(v) macro.Valentin Bartenev1-1/+6
Previously, it didn't work well for 0, 127, and 128, returning less than needed.
2015-10-26HTTP/2: fixed the NGX_HTTP_V2_MAX_FIELD macro.Valentin Bartenev1-1/+2
2015-09-28HTTP/2: fixed splitting of response headers on CONTINUATION frames.Valentin Bartenev1-173/+158
Previous code has been based on assumption that the header block can only be splitted at the borders of individual headers. That wasn't the case and might result in emitting frames bigger than the frame size limit. The current approach is to split header blocks by the frame size limit.
2015-10-26HTTP/2: introduced NGX_HTTP_V2_ENCODE_* macros.Valentin Bartenev1-11/+14
No functional changes.
2015-10-26HTTP/2: simplified producing of the Last-Modified header.Valentin Bartenev1-3/+2
2015-10-26HTTP/2: fixed header block size calculation.Valentin Bartenev1-1/+1
2015-10-01HTTP/2: fix handling of connection errors.Piotr Sikora1-6/+6
Previously, nginx worker would crash because of a double free if client disconnected or timed out before sending all headers. Found with afl-fuzz. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2015-10-01HTTP/2: fix indirect reprioritization.Piotr Sikora1-4/+13
Previously, streams that were indirectly reprioritized (either because of a new exclusive dependency on their parent or because of removal of their parent from the dependency tree), didn't have their pointer to the parent node updated. This broke detection of circular dependencies and, as a result, nginx worker would crash due to stack overflow whenever such dependency was introduced. Found with afl-fuzz. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2015-10-01HTTP/2: reject self-dependent streams.Piotr Sikora1-0/+16
Per RFC7540, a stream cannot depend on itself. Previously, this requirement was enforced on PRIORITY frames, but not on HEADERS frames and due to the implementation details nginx worker would crash (stack overflow) while opening self-dependent stream. Found with afl-fuzz. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2015-10-23Core: read/write locks are also required by the Stream module.Piotr Sikora1-1/+1
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2015-10-20HTTP/2: improved error handling while parsing integers.Valentin Bartenev1-4/+4
The case when an integer is out of frame bounds should be checked first as a more accurate error.
2015-10-20HTTP/2: improved HPACK integer parsing code readability.Ruslan Ermilov1-3/+3
No functional changes.
2015-10-20Win32: timer_resolution now ignored with select.Maxim Dounin1-0/+9
As setitimer() isn't available on Windows, time wasn't updated at all if timer_resolution was used with the select event method. Fix is to ignore timer_resolution in such cases.
2015-10-17Win32: fixed build with MinGW and MinGW-w64 gcc.Kouhei Sutou1-1/+1
This change fixes the "comparison between signed and unsigned integer expressions" warning, introduced in 5e6142609e48 (1.9.4).
2015-10-19Style: unneeded casts of cf->args->elts removed.Maxim Dounin1-2/+2
2015-10-19Fixed variables prefix comparison.Maxim Dounin1-12/+26
Variable names are not null-terminated, so using ngx_strncmp() without extra length checks is wrong. Reported by Markus Linnala, http://mailman.nginx.org/pipermail/nginx-devel/2015-August/007211.html.