summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-02-11SPDY: fixed parsing of http version.Xiaochen Wang1-0/+4
There is an error while parsing multi-digit minor version numbers (e.g. "HTTP/1.10").
2014-02-11SSL: the $ssl_session_reused variable.Maxim Dounin3-0/+19
2014-02-04Range filter: fixed duplicate charset.Ruslan Ermilov1-4/+8
If a proxied response had charset in Content-Type, the charset was duplicated in a response to client request with byte ranges.
2014-02-03Use ngx_socket_errno where appropriate.Piotr Sikora5-11/+11
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-02-05Version bump.Maxim Dounin1-2/+2
2014-02-04SPDY: fixed parsing of the priority field.Shigeki Ohtsu1-1/+1
The size of the priority field is increased by one bit in spdy/3, and now it's a 3-bit field followed by 5 bits of unused space. But a shift of these bits hasn't been adjusted in 39d7eef2e332 accordingly.
2014-02-04Core: added ngx_encode_base64url().Maxim Dounin2-12/+38
2014-01-30Core: handle getsockopt(TCP_FASTOPEN) failures.Piotr Sikora3-4/+10
Linux returns EOPNOTSUPP for non-TCP sockets and ENOPROTOOPT for TCP sockets, because getsockopt(TCP_FASTOPEN) is not implemented so far. While there, lower the log level from ALERT to NOTICE to match other getsockopt() failures. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-01-31SPDY: protocol implementation switched to spdy/3.1.Valentin Bartenev4-135/+815
2014-01-31Fixed false compiler warning.Vladimir Homutov1-0/+4
Newer gcc versions (4.7+) report possible use of uninitialized variable if nginx is being compiled with -O3.
2014-01-30Fixed a compile warning introduced by 01e2a5bcdd8f.Ruslan Ermilov1-3/+4
On systems with OpenSSL that has NPN support but lacks ALPN support, some compilers emitted a warning about possibly uninitialized "data" variable.
2014-01-30Proxy: fixed upstream search by proxy_pass with variables.Ruslan Ermilov1-1/+1
If "proxy_pass" is specified with variables, the resulting hostname is looked up in the list of upstreams defined in configuration. The search was case-sensitive, as opposed to the case of "proxy_pass" specified without variables.
2014-01-28SSL: support ALPN (IETF's successor to NPN).Piotr Sikora4-9/+89
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-01-29Mp4: fix seeks to standalone last chunk.Roman Arutyunyan1-1/+1
If seek position is within the last track chunk and that chunk is standalone (stsc entry describes only this chunk) such seek generates stsc seek error. The problem is that chunk numbers start with 1, not with 0.
2014-01-29Mp4: skip tracks shorter than seek position (ticket #414).Roman Arutyunyan1-6/+31
Mp4 module does not check movie and track durations when reading file. Instead it generates errors when track metadata is shorter than seek position. Now such tracks are skipped and movie duration check is performed at file read stage.
2014-01-29Mp4: fix seeks after the last key frame.Roman Arutyunyan1-5/+2
Mp4 module does not allow seeks after the last key frame. Since stss atom only contains key frames it's usually shorter than other track atoms. That leads to stss seek error when seek position is close to the end of file. The fix outputs empty stss frame instead of generating error.
2014-01-28Fixed TCP_DEFER_ACCEPT handling (ticket #353).Maxim Dounin2-24/+7
Backed out 05a56ebb084a, as it turns out that kernel can return connections without any delay if syncookies are used. This basically means we can't assume anything about connections returned with deferred accept set. To solve original problem the 05a56ebb084a tried to solve, i.e. to don't wait longer than needed if a connection was accepted after deferred accept timeout, this patch changes a timeout set with setsockopt(TCP_DEFER_ACCEPT) to 1 second, unconditionally. This is believed to be enough for speed improvements, and doesn't imply major changes to timeouts used. Note that before 2.6.32 connections were dropped after a timeout. Though it is believed that 1s is still appropriate for kernels before 2.6.32, as previously tcp_synack_retries controlled the actual timeout and 1s results in more than 1 minute actual timeout by default.
2014-01-28SSI: fixed $date_local and $date_gmt without SSI (ticket #230).Maxim Dounin1-5/+8
If there is no SSI context in a given request at a given time, the $date_local and $date_gmt variables used "%s" format, instead of "%A, %d-%b-%Y %H:%M:%S %Z" documented as the default and used if there is SSI module context and timefmt wasn't modified using the "config" SSI command. While use of these variables outside of the SSI evaluation isn't strictly valid, previous behaviour is certainly inconsistent, hence the fix.
2014-01-23Typo fixed.Tatsuhiko Kubo1-1/+1
2014-01-23SSL: fixed $ssl_session_id possible segfault after 97e3769637a7.Maxim Dounin1-0/+4
Even during execution of a request it is possible that there will be no session available, notably in case of renegotiation. As a result logging of $ssl_session_id in some cases caused NULL pointer dereference after revision 97e3769637a7 (1.5.9). The check added returns an empty string if there is no session available.
2014-01-23Version bump.Maxim Dounin1-2/+2
2014-01-22Upstream: reading from a client after connection upgrade.Maxim Dounin1-5/+1
Read event on a client connection might have been disabled during previous processing, and we at least need to handle events. Calling ngx_http_upstream_process_upgraded() is a simpliest way to do it. Notably this change is needed for select, poll and /dev/poll event methods. Previous version of this patch was posted here: http://mailman.nginx.org/pipermail/nginx/2014-January/041839.html
2014-01-22SSL: fixed $ssl_session_id variable.Maxim Dounin1-13/+3
Previously, it used to contain full session serialized instead of just a session id, making it almost impossible to use the variable in a safe way. Thanks to Ivan Ristić.
2014-01-20SPDY: use ngx_queue_t to queue streams for post processing.Valentin Bartenev3-24/+18
It simplifies the code and allows easy reuse the same queue pointer to store streams in various queues with different requirements. Future implementation of SPDY/3.1 will take advantage of this quality.
2014-01-22SPDY: store the length of frame instead of its whole size.Valentin Bartenev3-21/+20
The "length" value better corresponds with the specification and reduces confusion about whether frame's header is included in "size" or not. Also this change simplifies some parts of code, since in more cases the length of frame is more useful than its actual size, especially considering that the size of frame header is constant.
2014-01-22SPDY: use frame->next pointer to chain free frames.Valentin Bartenev3-11/+7
There is no need in separate "free" pointer and like it is for ngx_chain_t the "next" pointer can be used. But after this change successfully handled frame should not be accessed, so the frame handling cycle was improved to store pointer to the next frame before processing. Also worth noting that initializing "free" pointer to NULL in the original code was surplus.
2014-01-22SPDY: proper handling of all RST_STREAM statuses.Valentin Bartenev1-39/+28
Previously, only stream CANCEL and INTERNAL_ERROR were handled right.
2014-01-22SPDY: removed state to check first SETTINGS frame.Valentin Bartenev1-58/+15
That code was based on misunderstanding of spdy specification about configuration applicability in the SETTINGS frames. The original interpretation was that configuration is assigned for the whole SPDY connection, while it is only for the endpoint. Moreover, the strange thing is that specification forbids multiple entries in the SETTINGS frame with the same ID even if flags are different. As a result, Chrome sends two SETTINGS frames: one with its own configuration, and another one with configuration stored for a server (when the FLAG_SETTINGS_PERSIST_VALUE flags were used by the server). To simplify implementation we refuse to use the persistent settings feature and thereby avoid all the complexity related with its proper support.
2014-01-22SPDY: better name for frame entries counter.Valentin Bartenev2-12/+13
The "headers" is not a good term, since it is used not only to count name/value pairs in the HEADERS block but to count SETTINGS entries too. Moreover, one name/value pair in HEADERS can contain multiple http headers with the same name. No functional changes.
2014-01-22SPDY: fixed possible segfault.Valentin Bartenev1-0/+4
While processing a DATA frame, the link to related stream is stored in spdy connection object as part of connection state. But this stream can be closed between receiving parts of the frame.
2014-01-17Mail: fixed passing of IPv6 client address in XCLIENT.Ruslan Ermilov1-5/+28
2014-01-17Core: improved ngx_reset_pool() (ticket #490).Maxim Dounin1-2/+5
Previously pool->current wasn't moved back to pool, resulting in blocks not used for further allocations if pool->current was already moved at the time of ngx_reset_pool(). Additionally, to preserve logic of moving pool->current, the p->d.failed counters are now properly cleared. While here, pool->chain is also cleared. This change is essentially a nop with current code, but generally improves things.
2014-01-15SPDY: send output queue after processing of read event.Valentin Bartenev1-0/+5
During the processing of input some control frames can be added to the queue. And if there were no writing streams at the moment, these control frames might be left unsent for a long time (or even forever). This long delay is especially critical for PING replies since a client can consider connection as broken and then resend exactly the same request over a new connection, which is not safe in case of non-idempotent HTTP methods.
2014-01-15SPDY: the SETTINGS frame should be allocated from sc->pool.Valentin Bartenev1-8/+5
There is no reason to allocate it from connection pool that more like just a bug especially since ngx_http_spdy_settings_frame_handler() already uses sc->pool to free a chain.
2014-01-15SPDY: fixed possible uninitialized memory access.Valentin Bartenev1-2/+2
The frame->stream pointer should always be initialized for control frames since the check against it can be performed in ngx_http_spdy_filter_cleanup().
2014-01-15SPDY: fixed off_t/size_t type conversions on 32 bits platforms.Valentin Bartenev1-5/+4
Parameters of ngx_http_spdy_filter_get_shadow() are changed from size_t to off_t since the last call of the function may get size and offset from the rest of a file buffer. This fixes possible data loss rightfully complained by MSVC on 32 bits systems where off_t is 8 bytes long while size_t is only 4 bytes. The other two type casts are needed just to suppress warnings about possible data loss also complained by MSVC but false positive in these cases.
2014-01-15SPDY: fixed build, broken by b7ee1bae0ffa.Valentin Bartenev1-0/+4
False positive warning about the "cl" variable may be uninitialized in the ngx_http_spdy_filter_get_data_frame() call was suppressed. It is always initialized either in the "while" cycle or in the following "if" condition since frame_size cannot be zero.
2014-01-14SPDY: added the "spdy_chunk_size" directive.Valentin Bartenev3-6/+74
2014-01-14SPDY: implemented buffers chain splitting.Valentin Bartenev2-28/+164
It fixes "chain too big in spdy filter" alerts, and adds full support for rate limiting of SPDY streams.
2014-01-14SPDY: body filter was replaced by c->send_chain() function.Valentin Bartenev3-57/+43
It allows to use ngx_http_write_filter() and all its rate limiting logic.
2014-01-14SPDY: fixed possible premature close of stream.Valentin Bartenev1-0/+1
The "delayed" flag always should be set if there are unsent frames, but this might not be the case if ngx_http_spdy_body_filter() was called with NULL chain. As a result, the "send_timeout" timer could be set on a stream in ngx_http_writer(). And if the timeout occurred before all the stream data has been sent, then the request was finalized with the "client timed out" error.
2014-01-14SPDY: refactored ngx_http_spdy_body_filter().Valentin Bartenev1-5/+8
A local pointer to fake connection is introduced to slightly reduce further patches. No functional changes.
2014-01-14SPDY: elimination of r->blocked counter usage for queuing frames.Valentin Bartenev2-16/+10
It was used to prevent destroying of request object when there are unsent frames in queue for the stream. Since it was incremented for each frame and is only 8 bits long, so it was not very hard to overflow the counter. Now the stream->queued counter is checked instead.
2014-01-14SPDY: better name for flag that indicates incomplete frame state.Valentin Bartenev2-5/+5
No functional changes.
2014-01-14SPDY: better name for queued frames counter.Valentin Bartenev3-11/+12
No functional changes.
2014-01-14SPDY: fixed format specifiers in logging.Valentin Bartenev1-6/+6
2014-01-10Resolver: added support for domain names with a trailing dot.Yichun Zhang1-0/+4
2014-01-14SSL: fixed ssl_verify_depth to take only one argument.Maxim Dounin1-1/+1
2014-01-10SSL: ssl_session_tickets directive.Dirkjan Bussink4-0/+35
This adds support so it's possible to explicitly disable SSL Session Tickets. In order to have good Forward Secrecy support either the session ticket key has to be reloaded by using nginx' binary upgrade process or using an external key file and reloading the configuration. This directive adds another possibility to have good support by disabling session tickets altogether. If session tickets are enabled and the process lives for a long a time, an attacker can grab the session ticket from the process and use that to decrypt any traffic that occured during the entire lifetime of the process.
2014-01-04Fixed "zero size buf in output" alerts.Maxim Dounin1-21/+37
If a request had an empty request body (with Content-Length: 0), and there were preread data available (e.g., due to a pipelined request in the buffer), the "zero size buf in output" alert might be logged while proxying the request to an upstream. Similar alerts appeared with client_body_in_file_only if a request had an empty request body.