]> git.kaiwu.me - nginx.git/log
nginx.git
12 years agorelease-1.5.12 tag
Maxim Dounin [Tue, 18 Mar 2014 13:08:35 +0000 (17:08 +0400)]
release-1.5.12 tag

12 years agonginx-1.5.12-RELEASE release-1.5.12
Maxim Dounin [Tue, 18 Mar 2014 13:08:35 +0000 (17:08 +0400)]
nginx-1.5.12-RELEASE

12 years agoSPDY: always check size of data to be saved into state buffer.
Maxim Dounin [Tue, 18 Mar 2014 13:00:19 +0000 (17:00 +0400)]
SPDY: always check size of data to be saved into state buffer.

12 years agoAdded server-side support for PROXY protocol v1 (ticket #355).
Roman Arutyunyan [Mon, 17 Mar 2014 13:41:24 +0000 (17:41 +0400)]
Added server-side support for PROXY protocol v1 (ticket #355).

Client address specified in the PROXY protocol header is now
saved in the $proxy_protocol_addr variable and can be used in
the realip module.

This is currently not implemented for mail.

12 years agoFastCGI: f->split_parts reset on request start.
Maxim Dounin [Mon, 17 Mar 2014 11:34:36 +0000 (15:34 +0400)]
FastCGI: f->split_parts reset on request start.

Additionally, make sure to check for errors from ngx_http_parse_header_line()
call after joining saved parts.  There shouldn't be any errors, though
check may help to catch bugs like missing f->split_parts reset.

Reported by Lucas Molas.

12 years agoCore: fixed wrong indices in listening sockets compare loops.
Maxim Dounin [Fri, 7 Mar 2014 11:17:38 +0000 (15:17 +0400)]
Core: fixed wrong indices in listening sockets compare loops.

Proper use is "ls[i]" and "nls[n]".  Previous code used it wrong in
several places, likely due to cut-n-paste errors.

12 years agoMIME: added application/xspf+xml MIME type (ticket #479).
Filipe da Silva [Thu, 6 Mar 2014 09:51:08 +0000 (10:51 +0100)]
MIME: added application/xspf+xml MIME type (ticket #479).

12 years agoAdded connection serial number in logging of left open sockets.
Sergey Kandaurov [Thu, 6 Mar 2014 19:15:10 +0000 (23:15 +0400)]
Added connection serial number in logging of left open sockets.

12 years agoFixed format specifier in logging of "c->number".
Sergey Kandaurov [Thu, 6 Mar 2014 14:25:59 +0000 (18:25 +0400)]
Fixed format specifier in logging of "c->number".

12 years agoMIME: added video/mp2t and application/vnd.apple.mpegurl types.
Roman Arutyunyan [Tue, 4 Mar 2014 19:40:35 +0000 (23:40 +0400)]
MIME: added video/mp2t and application/vnd.apple.mpegurl types.

Both types are used by HLS.  The values are taken from RFC 3555
and HLS specification respectively.

12 years agoVersion bump.
Roman Arutyunyan [Tue, 4 Mar 2014 19:38:31 +0000 (23:38 +0400)]
Version bump.

12 years agorelease-1.5.11 tag
Maxim Dounin [Tue, 4 Mar 2014 11:39:23 +0000 (15:39 +0400)]
release-1.5.11 tag

12 years agonginx-1.5.11-RELEASE release-1.5.11
Maxim Dounin [Tue, 4 Mar 2014 11:39:23 +0000 (15:39 +0400)]
nginx-1.5.11-RELEASE

12 years agoSPDY: fixed potential integer overflow while parsing headers.
Valentin Bartenev [Mon, 3 Mar 2014 15:24:55 +0000 (19:24 +0400)]
SPDY: fixed potential integer overflow while parsing headers.

Previously r->header_size was used to store length for a part of
value that represents an individual already parsed HTTP header,
while r->header_end pointed to the end of the whole value.

Instead of storing length of a following name or value as pointer
to a potential end address (r->header_name_end and r->header_end)
that might be overflowed, now r->lowercase_index counter is used
to store remaining length of a following unparsed field.

It also fixes incorrect $body_bytes_sent value if a request is
closed while parsing of the request header.  Since r->header_size
is intended for counting header size, thus abusing it for header
parsing purpose was certainly a bad idea.

12 years agoSPDY: constant number of preallocated structures for headers.
Valentin Bartenev [Mon, 3 Mar 2014 15:24:54 +0000 (19:24 +0400)]
SPDY: constant number of preallocated structures for headers.

12 years agoRequest body: avoid potential overflow.
Maxim Dounin [Mon, 3 Mar 2014 13:39:53 +0000 (17:39 +0400)]
Request body: avoid potential overflow.

12 years agoGzip static: fixed NGX_CONF_FLAG misuse.
Valentin Bartenev [Mon, 3 Mar 2014 13:17:25 +0000 (17:17 +0400)]
Gzip static: fixed NGX_CONF_FLAG misuse.

12 years agoDocs: xslt regenerated.
Maxim Dounin [Fri, 28 Feb 2014 16:17:01 +0000 (20:17 +0400)]
Docs: xslt regenerated.

12 years agoDocs: switched from java XSLScript to xslscript.pl.
Maxim Dounin [Fri, 28 Feb 2014 16:17:00 +0000 (20:17 +0400)]
Docs: switched from java XSLScript to xslscript.pl.

Latter is available from http://hg.nginx.org/xslscript.

12 years agoDisabled redirects to named locations if URI is not set.
Maxim Dounin [Thu, 27 Feb 2014 16:36:35 +0000 (20:36 +0400)]
Disabled redirects to named locations if URI is not set.

If something like "error_page 400 @name" is used in a configuration,
a request could be passed to a named location without URI set, and this
in turn might result in segmentation faults or other bad effects
as most of the code assumes URI is set.

With this change nginx will catch such configuration problems in
ngx_http_named_location() and will stop request processing if URI
is not set, returning 500.

12 years agoCore: allocate enough memory to hold IPv6 text address plus port.
Ruslan Ermilov [Sat, 22 Feb 2014 08:08:31 +0000 (12:08 +0400)]
Core: allocate enough memory to hold IPv6 text address plus port.

12 years agoResolver: properly handle connect() failures.
Ruslan Ermilov [Thu, 20 Feb 2014 13:27:09 +0000 (17:27 +0400)]
Resolver: properly handle connect() failures.

If initial attempt to connect() the UDP socket failed, e.g.
due to network unreachable, no further attempts were made.

12 years agoUpstream: fixed error message wording.
Konstantin Pavlov [Thu, 20 Feb 2014 09:48:40 +0000 (13:48 +0400)]
Upstream: fixed error message wording.

12 years agoAccess: supplemented the obfuscated code with a comment.
Ruslan Ermilov [Wed, 19 Feb 2014 17:45:27 +0000 (21:45 +0400)]
Access: supplemented the obfuscated code with a comment.

12 years agoUpstream: ngx_post_event() instead of upgraded call (ticket #503).
Maxim Dounin [Tue, 18 Feb 2014 13:30:40 +0000 (17:30 +0400)]
Upstream: ngx_post_event() instead of upgraded call (ticket #503).

If a request is finalized in the first call to the
ngx_http_upstream_process_upgraded() function, e.g., because upstream
server closed the connection for some reason, in the second call
the u->peer.connection pointer will be null, resulting in segmentation
fault.

Fix is to avoid second direct call, and post event instead.  This ensures
that ngx_http_upstream_process_upgraded() won't be called again if
a request is finalized.

12 years agoMp4: remove useless leading stsc entry in result mp4.
Roman Arutyunyan [Fri, 14 Feb 2014 11:14:48 +0000 (15:14 +0400)]
Mp4: remove useless leading stsc entry in result mp4.

The fix removes useless stsc entry in result mp4.
If start_sample == n then current stsc entry should be skipped
and the result stsc should start with the next entry.
The reason for that is start_sample starts from 0, not 1.

12 years agoWin32: MSVC 2013 compatibility.
Maxim Dounin [Thu, 13 Feb 2014 12:54:00 +0000 (16:54 +0400)]
Win32: MSVC 2013 compatibility.

Warnings about GetVersionEx() deprecation silenced.  Precompiled object
linked in.

12 years agoSPDY: fixed reversed priority order in window waiting queue.
Valentin Bartenev [Wed, 12 Feb 2014 17:02:29 +0000 (21:02 +0400)]
SPDY: fixed reversed priority order in window waiting queue.

12 years agoUpstream: fix $upstream_status variable.
Piotr Sikora [Wed, 12 Feb 2014 05:54:42 +0000 (21:54 -0800)]
Upstream: fix $upstream_status variable.

Previously, upstream's status code was overwritten with
cached response's status code when STALE or REVALIDATED
response was sent to the client.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoSPDY: fixed parsing of http version.
Xiaochen Wang [Tue, 11 Feb 2014 12:54:16 +0000 (20:54 +0800)]
SPDY: fixed parsing of http version.

There is an error while parsing multi-digit minor version numbers (e.g.
"HTTP/1.10").

12 years agoSSL: the $ssl_session_reused variable.
Maxim Dounin [Tue, 11 Feb 2014 15:20:25 +0000 (19:20 +0400)]
SSL: the $ssl_session_reused variable.

12 years agoRange filter: fixed duplicate charset.
Ruslan Ermilov [Tue, 4 Feb 2014 13:13:35 +0000 (17:13 +0400)]
Range filter: fixed duplicate charset.

If a proxied response had charset in Content-Type, the
charset was duplicated in a response to client request
with byte ranges.

12 years agoUse ngx_socket_errno where appropriate.
Piotr Sikora [Mon, 3 Feb 2014 22:17:17 +0000 (14:17 -0800)]
Use ngx_socket_errno where appropriate.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoVersion bump.
Maxim Dounin [Wed, 5 Feb 2014 14:51:30 +0000 (18:51 +0400)]
Version bump.

12 years agorelease-1.5.10 tag
Maxim Dounin [Tue, 4 Feb 2014 12:26:46 +0000 (16:26 +0400)]
release-1.5.10 tag

12 years agonginx-1.5.10-RELEASE release-1.5.10
Maxim Dounin [Tue, 4 Feb 2014 12:26:46 +0000 (16:26 +0400)]
nginx-1.5.10-RELEASE

12 years agoSPDY: fixed parsing of the priority field.
Shigeki Ohtsu [Tue, 4 Feb 2014 05:06:23 +0000 (14:06 +0900)]
SPDY: fixed parsing of the priority field.

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.

12 years agoUpdated PCRE used for win32 builds.
Maxim Dounin [Tue, 4 Feb 2014 03:45:33 +0000 (07:45 +0400)]
Updated PCRE used for win32 builds.

12 years agoCore: added ngx_encode_base64url().
Maxim Dounin [Tue, 4 Feb 2014 00:59:21 +0000 (04:59 +0400)]
Core: added ngx_encode_base64url().

12 years agoCore: handle getsockopt(TCP_FASTOPEN) failures.
Piotr Sikora [Thu, 30 Jan 2014 22:58:21 +0000 (14:58 -0800)]
Core: handle getsockopt(TCP_FASTOPEN) failures.

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>
12 years agoSPDY: protocol implementation switched to spdy/3.1.
Valentin Bartenev [Fri, 31 Jan 2014 15:17:26 +0000 (19:17 +0400)]
SPDY: protocol implementation switched to spdy/3.1.

12 years agoFixed false compiler warning.
Vladimir Homutov [Fri, 31 Jan 2014 10:18:52 +0000 (14:18 +0400)]
Fixed false compiler warning.

Newer gcc versions (4.7+) report possible use of uninitialized variable if
nginx is being compiled with -O3.

12 years agoFixed a compile warning introduced by 01e2a5bcdd8f.
Ruslan Ermilov [Thu, 30 Jan 2014 15:13:12 +0000 (19:13 +0400)]
Fixed a compile warning introduced by 01e2a5bcdd8f.

On systems with OpenSSL that has NPN support but lacks
ALPN support, some compilers emitted a warning about
possibly uninitialized "data" variable.

12 years agoProxy: fixed upstream search by proxy_pass with variables.
Ruslan Ermilov [Thu, 30 Jan 2014 14:57:11 +0000 (18:57 +0400)]
Proxy: fixed upstream search by proxy_pass with variables.

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.

12 years agoSSL: support ALPN (IETF's successor to NPN).
Piotr Sikora [Tue, 28 Jan 2014 23:33:49 +0000 (15:33 -0800)]
SSL: support ALPN (IETF's successor to NPN).

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoMp4: fix seeks to standalone last chunk.
Roman Arutyunyan [Wed, 29 Jan 2014 09:44:15 +0000 (13:44 +0400)]
Mp4: fix seeks to standalone last chunk.

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.

12 years agoMp4: skip tracks shorter than seek position (ticket #414).
Roman Arutyunyan [Wed, 29 Jan 2014 09:33:45 +0000 (13:33 +0400)]
Mp4: skip tracks shorter than seek position (ticket #414).

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.

12 years agoMp4: fix seeks after the last key frame.
Roman Arutyunyan [Wed, 29 Jan 2014 09:30:36 +0000 (13:30 +0400)]
Mp4: fix seeks after the last key frame.

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.

12 years agoFixed TCP_DEFER_ACCEPT handling (ticket #353).
Maxim Dounin [Tue, 28 Jan 2014 11:40:46 +0000 (15:40 +0400)]
Fixed TCP_DEFER_ACCEPT handling (ticket #353).

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.

12 years agoSSI: fixed $date_local and $date_gmt without SSI (ticket #230).
Maxim Dounin [Tue, 28 Jan 2014 11:40:45 +0000 (15:40 +0400)]
SSI: fixed $date_local and $date_gmt without SSI (ticket #230).

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.

12 years agoConfigure: enabled -Werror for clang.
Ruslan Ermilov [Mon, 27 Jan 2014 20:31:31 +0000 (00:31 +0400)]
Configure: enabled -Werror for clang.

Modern clang versions seem to no longer produce warnings for
system headers on Linux (at least clang 3.3 works), hence the
change.  For older versions --with-cc-opt="-Wno-error" can be
used as a workaround.

12 years agoTypo fixed.
Tatsuhiko Kubo [Thu, 23 Jan 2014 13:09:59 +0000 (22:09 +0900)]
Typo fixed.

12 years agoSSL: fixed $ssl_session_id possible segfault after 97e3769637a7.
Maxim Dounin [Thu, 23 Jan 2014 14:32:26 +0000 (18:32 +0400)]
SSL: fixed $ssl_session_id possible segfault after 97e3769637a7.

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.

12 years agoVersion bump.
Maxim Dounin [Thu, 23 Jan 2014 14:32:25 +0000 (18:32 +0400)]
Version bump.

12 years agorelease-1.5.9 tag
Maxim Dounin [Wed, 22 Jan 2014 13:42:59 +0000 (17:42 +0400)]
release-1.5.9 tag

12 years agonginx-1.5.9-RELEASE release-1.5.9
Maxim Dounin [Wed, 22 Jan 2014 13:42:59 +0000 (17:42 +0400)]
nginx-1.5.9-RELEASE

12 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Wed, 22 Jan 2014 12:10:13 +0000 (16:10 +0400)]
Updated OpenSSL used for win32 builds.

12 years agoUpstream: reading from a client after connection upgrade.
Maxim Dounin [Wed, 22 Jan 2014 12:05:07 +0000 (16:05 +0400)]
Upstream: reading from a client after connection upgrade.

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

12 years agoSSL: fixed $ssl_session_id variable.
Maxim Dounin [Wed, 22 Jan 2014 12:05:06 +0000 (16:05 +0400)]
SSL: fixed $ssl_session_id variable.

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ć.

12 years agoSPDY: use ngx_queue_t to queue streams for post processing.
Valentin Bartenev [Mon, 20 Jan 2014 16:56:49 +0000 (20:56 +0400)]
SPDY: use ngx_queue_t to queue streams for post processing.

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.

12 years agoSPDY: store the length of frame instead of its whole size.
Valentin Bartenev [Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)]
SPDY: store the length of frame instead of its whole size.

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.

12 years agoSPDY: use frame->next pointer to chain free frames.
Valentin Bartenev [Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)]
SPDY: use frame->next pointer to chain free frames.

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.

12 years agoSPDY: proper handling of all RST_STREAM statuses.
Valentin Bartenev [Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)]
SPDY: proper handling of all RST_STREAM statuses.

Previously, only stream CANCEL and INTERNAL_ERROR were handled right.

12 years agoSPDY: removed state to check first SETTINGS frame.
Valentin Bartenev [Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)]
SPDY: removed state to check first SETTINGS frame.

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.

12 years agoSPDY: better name for frame entries counter.
Valentin Bartenev [Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)]
SPDY: better name for frame entries counter.

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.

12 years agoSPDY: fixed possible segfault.
Valentin Bartenev [Wed, 22 Jan 2014 00:58:19 +0000 (04:58 +0400)]
SPDY: fixed possible segfault.

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.

12 years agoTypo fixed.
Maxim Dounin [Tue, 21 Jan 2014 13:39:49 +0000 (17:39 +0400)]
Typo fixed.

12 years agoMail: fixed passing of IPv6 client address in XCLIENT.
Ruslan Ermilov [Fri, 17 Jan 2014 18:06:04 +0000 (22:06 +0400)]
Mail: fixed passing of IPv6 client address in XCLIENT.

12 years agoCore: improved ngx_reset_pool() (ticket #490).
Maxim Dounin [Fri, 17 Jan 2014 02:24:53 +0000 (06:24 +0400)]
Core: improved ngx_reset_pool() (ticket #490).

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.

12 years agoSPDY: send output queue after processing of read event.
Valentin Bartenev [Wed, 15 Jan 2014 13:16:38 +0000 (17:16 +0400)]
SPDY: send output queue after processing of read event.

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.

12 years agoSPDY: the SETTINGS frame should be allocated from sc->pool.
Valentin Bartenev [Wed, 15 Jan 2014 13:16:38 +0000 (17:16 +0400)]
SPDY: the SETTINGS frame should be allocated from sc->pool.

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.

12 years agoSPDY: fixed possible uninitialized memory access.
Valentin Bartenev [Wed, 15 Jan 2014 13:16:38 +0000 (17:16 +0400)]
SPDY: fixed possible uninitialized memory access.

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().

12 years agoSPDY: fixed off_t/size_t type conversions on 32 bits platforms.
Valentin Bartenev [Wed, 15 Jan 2014 09:23:31 +0000 (13:23 +0400)]
SPDY: fixed off_t/size_t type conversions on 32 bits platforms.

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.

12 years agoSPDY: fixed build, broken by b7ee1bae0ffa.
Valentin Bartenev [Tue, 14 Jan 2014 21:44:52 +0000 (01:44 +0400)]
SPDY: fixed build, broken by b7ee1bae0ffa.

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.

12 years agoSPDY: added the "spdy_chunk_size" directive.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: added the "spdy_chunk_size" directive.

12 years agoSPDY: implemented buffers chain splitting.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: implemented buffers chain splitting.

It fixes "chain too big in spdy filter" alerts, and adds full support for rate
limiting of SPDY streams.

12 years agoSPDY: body filter was replaced by c->send_chain() function.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: body filter was replaced by c->send_chain() function.

It allows to use ngx_http_write_filter() and all its rate limiting logic.

12 years agoSPDY: fixed possible premature close of stream.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: fixed possible premature close of stream.

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.

12 years agoSPDY: refactored ngx_http_spdy_body_filter().
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: refactored ngx_http_spdy_body_filter().

A local pointer to fake connection is introduced
to slightly reduce further patches.

No functional changes.

12 years agoSPDY: elimination of r->blocked counter usage for queuing frames.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: elimination of r->blocked counter usage for queuing frames.

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.

12 years agoSPDY: better name for flag that indicates incomplete frame state.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: better name for flag that indicates incomplete frame state.

No functional changes.

12 years agoSPDY: better name for queued frames counter.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: better name for queued frames counter.

No functional changes.

12 years agoSPDY: fixed format specifiers in logging.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:45 +0000 (16:24 +0400)]
SPDY: fixed format specifiers in logging.

12 years agoYear 2014.
Valentin Bartenev [Tue, 14 Jan 2014 12:24:02 +0000 (16:24 +0400)]
Year 2014.

12 years agoResolver: added support for domain names with a trailing dot.
Yichun Zhang [Fri, 10 Jan 2014 19:22:14 +0000 (11:22 -0800)]
Resolver: added support for domain names with a trailing dot.

12 years agoSSL: fixed ssl_verify_depth to take only one argument.
Maxim Dounin [Tue, 14 Jan 2014 11:56:40 +0000 (15:56 +0400)]
SSL: fixed ssl_verify_depth to take only one argument.

12 years agoSSL: ssl_session_tickets directive.
Dirkjan Bussink [Fri, 10 Jan 2014 15:12:40 +0000 (16:12 +0100)]
SSL: ssl_session_tickets directive.

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.

12 years agoFixed "zero size buf in output" alerts.
Maxim Dounin [Fri, 3 Jan 2014 23:32:22 +0000 (03:32 +0400)]
Fixed "zero size buf in output" alerts.

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.

12 years agoWin32: support for UTF-16 surrogate pairs (ticket #457).
Maxim Dounin [Fri, 3 Jan 2014 23:32:15 +0000 (03:32 +0400)]
Win32: support for UTF-16 surrogate pairs (ticket #457).

12 years agoUpstream: Cache-Control preferred over Expires.
Maxim Dounin [Fri, 3 Jan 2014 23:32:10 +0000 (03:32 +0400)]
Upstream: Cache-Control preferred over Expires.

Not really a strict check (as X-Accel-Expires might be ignored or
contain invalid value), but quite simple to implement and better
than what we have now.

12 years agoAdded per-process random seeding (ticket #456).
Maxim Dounin [Fri, 3 Jan 2014 23:32:06 +0000 (03:32 +0400)]
Added per-process random seeding (ticket #456).

12 years agoAllowed up to two EBUSY errors from sendfile().
Maxim Dounin [Fri, 3 Jan 2014 23:31:58 +0000 (03:31 +0400)]
Allowed up to two EBUSY errors from sendfile().

Fallback to synchronous sendfile() now only done on 3rd EBUSY without
any progress in a row.  Not falling back is believed to be better
in case of occasional EBUSY, though protection is still needed to
make sure there will be no infinite loop.

12 years agoFixed setting of content type in some cases.
Ruslan Ermilov [Fri, 27 Dec 2013 15:40:04 +0000 (19:40 +0400)]
Fixed setting of content type in some cases.

This fixes content type set in stub_status and autoindex responses
to be usable in content type checks made by filter modules, such
as charset and sub filters.

12 years agoStyle: removed surplus semicolons.
Valentin Bartenev [Fri, 27 Dec 2013 14:47:42 +0000 (18:47 +0400)]
Style: removed surplus semicolons.

12 years agoSPDY: a bit smarter ngx_http_spdy_filter_get_data_frame().
Valentin Bartenev [Thu, 26 Dec 2013 13:03:16 +0000 (17:03 +0400)]
SPDY: a bit smarter ngx_http_spdy_filter_get_data_frame().

There is no need to pass FLAG_FIN as a separate argument since it can always be
detected from the last_buf flag of the last frame buffer.

No functional changes.

12 years agoSPDY: refactored loop in ngx_http_spdy_body_filter().
Valentin Bartenev [Thu, 26 Dec 2013 13:03:16 +0000 (17:03 +0400)]
SPDY: refactored loop in ngx_http_spdy_body_filter().

No functional changes.

12 years agoSPDY: fixed possible request hang.
Valentin Bartenev [Thu, 26 Dec 2013 13:03:16 +0000 (17:03 +0400)]
SPDY: fixed possible request hang.

Processing events from upstream connection can result in sending queued frames
from other streams.  In this case such streams were not added to handling queue
and properly handled.

A global per connection flag was replaced by a per stream flag that indicates
currently sending stream while all other streams can be added to handling
queue.

12 years agoDav: emit a warning about unsafe URI.
Ruslan Ermilov [Mon, 23 Dec 2013 14:12:03 +0000 (18:12 +0400)]
Dav: emit a warning about unsafe URI.

12 years agoTeach ngx_http_parse_unsafe_uri() how to unescape URIs.
Ruslan Ermilov [Mon, 23 Dec 2013 14:12:00 +0000 (18:12 +0400)]
Teach ngx_http_parse_unsafe_uri() how to unescape URIs.

This fixes handling of escaped URIs in X-Accel-Redirect (ticket #316),
SSI (ticket #240), and DAV.

12 years agoDetect more unsafe URIs in ngx_http_parse_unsafe_uri().
Ruslan Ermilov [Mon, 23 Dec 2013 14:11:56 +0000 (18:11 +0400)]
Detect more unsafe URIs in ngx_http_parse_unsafe_uri().

The following URIs were considered safe: "..", "../foo", and "/foo/..".