]> git.kaiwu.me - nginx.git/log
nginx.git
11 years agoCore: expose maximum values of time_t and ngx_int_t.
Ruslan Ermilov [Mon, 16 Mar 2015 21:24:34 +0000 (00:24 +0300)]
Core: expose maximum values of time_t and ngx_int_t.

These are needed to detect overflows.

11 years agoCore: fixed potential buffer overrun when initializing hash.
Maxim Dounin [Tue, 24 Feb 2015 15:37:14 +0000 (18:37 +0300)]
Core: fixed potential buffer overrun when initializing hash.

Initial size as calculated from the number of elements may be bigger
than max_size.  If this happens, make sure to set size to max_size.

Reported by Chris West.

11 years agoCore: fixed a race resulting in extra sem_post()'s.
Roman Arutyunyan [Wed, 4 Feb 2015 13:22:43 +0000 (16:22 +0300)]
Core: fixed a race resulting in extra sem_post()'s.

The mtx->wait counter was not decremented if we were able to obtain the lock
right after incrementing it.  This resulted in unneeded sem_post() calls,
eventually leading to EOVERFLOW errors being logged, "sem_post() failed
while wake shmtx (75: Value too large for defined data type)".

To close the race, mtx->wait is now decremented if we obtain the lock right
after incrementing it in ngx_shmtx_lock().  The result can become -1 if a
concurrent ngx_shmtx_unlock() decrements mtx->wait before the added code does.
However, that only leads to one extra iteration in the next call of
ngx_shmtx_lock().

11 years agoFixed post_action to not trigger "header already sent" alert.
Maxim Dounin [Fri, 28 Nov 2014 13:57:50 +0000 (16:57 +0300)]
Fixed post_action to not trigger "header already sent" alert.

The alert was introduced in 03ff14058272 (1.5.4), and was triggered on each
post_action invocation.

There is no real need to call header filters in case of post_action,
so return NGX_OK from ngx_http_send_header() if r->post_action is set.

11 years agoSPDY: push pending data while closing a stream as with keepalive.
Valentin Bartenev [Fri, 21 Nov 2014 19:51:49 +0000 (22:51 +0300)]
SPDY: push pending data while closing a stream as with keepalive.

This helps to avoid delays in sending the last chunk of data because
of bad interaction between Nagle's algorithm on nginx side and
delayed ACK on the client side.

Delays could also be caused by TCP_CORK/TCP_NOPUSH if SPDY was
working without SSL and sendfile() was used.

11 years agoResolver: fixed use-after-free memory access.
Ruslan Ermilov [Thu, 20 Nov 2014 12:24:40 +0000 (15:24 +0300)]
Resolver: fixed use-after-free memory access.

In 954867a2f0a6, we switched to using resolver node as the
timer event data, so make sure we do not free resolver node
memory until the corresponding timer is deleted.

11 years agoSSL: logging level of "inappropriate fallback" (ticket #662).
Maxim Dounin [Mon, 17 Nov 2014 13:38:48 +0000 (16:38 +0300)]
SSL: logging level of "inappropriate fallback" (ticket #662).

Patch by Erik Dubbelboer.

11 years agoFixed possible buffer overrun in "too long header line" logging.
Maxim Dounin [Wed, 8 Oct 2014 13:16:04 +0000 (17:16 +0400)]
Fixed possible buffer overrun in "too long header line" logging.

Additionally, ellipsis now always added to make it clear that
the header logged is incomplete.

Reported by Daniil Bondarev.

11 years agoCore: fixed buffer overrun when hash max_size reached.
Yichun Zhang [Thu, 2 Oct 2014 19:00:17 +0000 (12:00 -0700)]
Core: fixed buffer overrun when hash max_size reached.

11 years agoVersion bump.
Maxim Dounin [Mon, 6 Apr 2015 15:54:19 +0000 (18:54 +0300)]
Version bump.

11 years agorelease-1.6.2 tag
Maxim Dounin [Tue, 16 Sep 2014 12:23:19 +0000 (16:23 +0400)]
release-1.6.2 tag

11 years agonginx-1.6.2-RELEASE release-1.6.2
Maxim Dounin [Tue, 16 Sep 2014 12:23:18 +0000 (16:23 +0400)]
nginx-1.6.2-RELEASE

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Mon, 15 Sep 2014 14:03:49 +0000 (18:03 +0400)]
Updated OpenSSL used for win32 builds.

11 years agoSSL: session id context now includes certificate hash.
Maxim Dounin [Mon, 15 Sep 2014 13:59:47 +0000 (17:59 +0400)]
SSL: session id context now includes certificate hash.

This prevents inappropriate session reuse in unrelated server{}
blocks, while preserving ability to restore sessions on other servers
when using TLS Session Tickets.

Additionally, session context is now set even if there is no session cache
configured.  This is needed as it's also used for TLS Session Tickets.

Thanks to Antoine Delignat-Lavaud and Piotr Sikora.

11 years agoResolver: notify all waiting requests on timeout.
Ruslan Ermilov [Tue, 19 Aug 2014 11:43:26 +0000 (15:43 +0400)]
Resolver: notify all waiting requests on timeout.

If a "resolver_timeout" occurs, only the first waiting request
was notified.  Other requests may hang forever.

11 years agoResolver: fixed resend on malformed responses.
Ruslan Ermilov [Wed, 16 Jul 2014 06:21:28 +0000 (10:21 +0400)]
Resolver: fixed resend on malformed responses.

DNS request resend on malformed responses was broken in 98876ce2a7fd (1.5.8).

Reported by Pramod Korathota.

11 years agoVersion bump.
Maxim Dounin [Mon, 15 Sep 2014 19:39:21 +0000 (23:39 +0400)]
Version bump.

11 years agorelease-1.6.1 tag
Maxim Dounin [Tue, 5 Aug 2014 11:18:34 +0000 (15:18 +0400)]
release-1.6.1 tag

11 years agonginx-1.6.1-RELEASE release-1.6.1
Maxim Dounin [Tue, 5 Aug 2014 11:18:34 +0000 (15:18 +0400)]
nginx-1.6.1-RELEASE

11 years agoMail: discard pipelined commands after SMTP STARTTLS.
Maxim Dounin [Tue, 5 Aug 2014 08:22:07 +0000 (12:22 +0400)]
Mail: discard pipelined commands after SMTP STARTTLS.

The bug had appeared in nginx 1.5.6 (04e43d03e153).

Reported by Chris Boulton.

11 years agoReset of r->uri.len on URI parsing errors.
Maxim Dounin [Fri, 18 Jul 2014 16:02:11 +0000 (20:02 +0400)]
Reset of r->uri.len on URI parsing errors.

This ensures that debug logging and the $uri variable (if used in
400 Bad Request processing) will not try to access uninitialized
memory.

Found by Sergey Bobrov.

11 years agoUpdated PCRE used for win32 builds.
Maxim Dounin [Fri, 4 Jul 2014 18:34:03 +0000 (22:34 +0400)]
Updated PCRE used for win32 builds.

11 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 17 Jun 2014 07:38:55 +0000 (11:38 +0400)]
Updated OpenSSL used for win32 builds.

11 years agoMail: added a check for the number of arguments in MAIL/RCPT.
Maxim Dounin [Wed, 21 May 2014 17:56:20 +0000 (21:56 +0400)]
Mail: added a check for the number of arguments in MAIL/RCPT.

Missed during introduction of the SMTP pipelining support (04e43d03e153,
1.5.6).  Previously, the check wasn't needed as s->buffer was used directly
and the number of arguments didn't matter.

Reported by Svyatoslav Nikolsky.

11 years agoVersion bump.
Maxim Dounin [Tue, 5 Aug 2014 08:20:22 +0000 (12:20 +0400)]
Version bump.

12 years agorelease-1.6.0 tag
Maxim Dounin [Thu, 24 Apr 2014 12:52:24 +0000 (16:52 +0400)]
release-1.6.0 tag

12 years agonginx-1.6.0-RELEASE release-1.6.0
Maxim Dounin [Thu, 24 Apr 2014 12:52:24 +0000 (16:52 +0400)]
nginx-1.6.0-RELEASE

12 years agoMissed comma fixed. A couple of Latin symbols plugged into
Maxim Konovalov [Wed, 23 Apr 2014 16:00:59 +0000 (16:00 +0000)]
Missed comma fixed.  A couple of Latin symbols plugged into
Russian text changed to Russian counterparts.

12 years agoVersion bump.
Maxim Dounin [Fri, 18 Apr 2014 16:10:42 +0000 (20:10 +0400)]
Version bump.

12 years agostable-1.6 branch
Maxim Dounin [Fri, 18 Apr 2014 16:08:47 +0000 (20:08 +0400)]
stable-1.6 branch

12 years agoSPDY: fixed typo in log message.
Valentin Bartenev [Wed, 16 Apr 2014 07:40:42 +0000 (11:40 +0400)]
SPDY: fixed typo in log message.

12 years agoFixed missing "static" in declaration of ngx_http_gzip_quantity().
Valentin Bartenev [Wed, 16 Apr 2014 07:40:38 +0000 (11:40 +0400)]
Fixed missing "static" in declaration of ngx_http_gzip_quantity().

12 years agoSPDY: moved a variable initialization near to its check.
Valentin Bartenev [Wed, 9 Apr 2014 14:15:32 +0000 (18:15 +0400)]
SPDY: moved a variable initialization near to its check.

This should prevent attempts of using pointer before it was checked, since
all modern compilers are able to spot access to uninitialized variable.

No functional changes.

12 years agoSPDY: fixed arguments supplied for an error message.
Valentin Bartenev [Tue, 8 Apr 2014 16:12:30 +0000 (20:12 +0400)]
SPDY: fixed arguments supplied for an error message.

12 years agoVersion bump.
Valentin Bartenev [Tue, 8 Apr 2014 16:11:31 +0000 (20:11 +0400)]
Version bump.

12 years agorelease-1.5.13 tag
Maxim Dounin [Tue, 8 Apr 2014 14:15:22 +0000 (18:15 +0400)]
release-1.5.13 tag

12 years agonginx-1.5.13-RELEASE release-1.5.13
Maxim Dounin [Tue, 8 Apr 2014 14:15:21 +0000 (18:15 +0400)]
nginx-1.5.13-RELEASE

12 years agoUpdated OpenSSL used for win32 builds.
Maxim Dounin [Tue, 8 Apr 2014 13:48:03 +0000 (17:48 +0400)]
Updated OpenSSL used for win32 builds.

12 years agoSPDY: avoid creating flush frames.
Valentin Bartenev [Mon, 7 Apr 2014 19:35:33 +0000 (23:35 +0400)]
SPDY: avoid creating flush frames.

Previously, an empty frame object was created for an output chain that contains
only sync or flush empty buffers.  But since 39d7eef2e332 every DATA frame has
the flush flag set on its last buffer, so there's no need any more in additional
flush buffers in the output queue and they can be skipped.

Note that such flush frames caused an incorrect $body_bytes_sent value.

12 years agoSPDY: consistently handle control frames with unknown type.
Valentin Bartenev [Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)]
SPDY: consistently handle control frames with unknown type.

The SPDY draft 2 specification requires that if an endpoint receives a
control frame for a type it does not recognize, it must ignore the frame.
But the 3 and 3.1 drafts don't seem to declare any behavior for such case.
Then sticking with the previous draft in this matter looks to be right.

But previously, only 8 least significant bits of the type field were
parsed while the rest of 16 bits of the field were checked against zero.
Though there are no known frame types bigger than 255, this resulted in
inconsistency in handling of such frames: they were not recognized as
valid frames at all, and the connection was closed.

12 years agoSPDY: refactored ngx_http_spdy_state_read_data().
Valentin Bartenev [Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)]
SPDY: refactored ngx_http_spdy_state_read_data().

There's no more need in a separate indicator of frame completeness
after d74889fbf06d.

12 years agoSPDY: better detect premature closing of stream.
Valentin Bartenev [Mon, 7 Apr 2014 15:27:56 +0000 (19:27 +0400)]
SPDY: better detect premature closing of stream.

Following a24f88eff684, now the case when the FIN flag is set in SYN_STREAM
is also covered.

12 years agoWin32: fixed shared ssl_session_cache (ticket #528).
Maxim Dounin [Mon, 7 Apr 2014 14:55:57 +0000 (18:55 +0400)]
Win32: fixed shared ssl_session_cache (ticket #528).

In a worker process shm_zone->data was set to NULL instead of a proper value
extracted from shared memory.

12 years agoWin32: fixed link flags with MSVC, broken by bfe536716dbf.
Maxim Dounin [Mon, 7 Apr 2014 14:29:05 +0000 (18:29 +0400)]
Win32: fixed link flags with MSVC, broken by bfe536716dbf.

Notably, "-debug" was omitted, resulting in an executable without debug
symbols.

12 years agoMp4: allow end values bigger than track duration.
Roman Arutyunyan [Tue, 1 Apr 2014 16:53:18 +0000 (20:53 +0400)]
Mp4: allow end values bigger than track duration.

If start time is within the track but end time is out of it, error
"end time is out mp4 stts samples" is generated.  However it's
better to ignore the error and output the track until its end.

12 years agoAdjusted default value of types_hash_bucket_size (ticket #352).
Maxim Dounin [Mon, 31 Mar 2014 18:47:42 +0000 (22:47 +0400)]
Adjusted default value of types_hash_bucket_size (ticket #352).

The ngx_cacheline_size may be too low on some platforms, resulting
in unexpected hash build problems (as no collisions are tolerated due
to low bucket_size, and max_size isn't big enough to build a hash without
collisions).  These problems aren't fatal anymore but nevertheless
need to be addressed.

12 years agoCore: fixed hash to actually try max_size.
Maxim Dounin [Mon, 31 Mar 2014 17:40:35 +0000 (21:40 +0400)]
Core: fixed hash to actually try max_size.

Previously, maximum size of a hash table built was (max_size - 1).

12 years agoCore: hash now ignores bucket_size if it hits max_size limit.
Maxim Dounin [Mon, 31 Mar 2014 17:40:31 +0000 (21:40 +0400)]
Core: hash now ignores bucket_size if it hits max_size limit.

12 years agoCore: slab log_nomem flag.
Maxim Dounin [Mon, 31 Mar 2014 17:38:30 +0000 (21:38 +0400)]
Core: slab log_nomem flag.

The flag allows to suppress "ngx_slab_alloc() failed: no memory" messages
from a slab allocator, e.g., if an LRU expiration is used by a consumer
and allocation failures aren't fatal.

The flag is now used in the SSL session cache code, and in the limit_req
module.

12 years agoWin32: fixed cpu hog by cache manager on exit (ticket #514).
Maxim Dounin [Mon, 31 Mar 2014 17:38:28 +0000 (21:38 +0400)]
Win32: fixed cpu hog by cache manager on exit (ticket #514).

The "ngx_quit" may be reset by the worker thread before it's seen
by a ngx_cache_manager_thread(), resulting in an infinite loop.  Make
sure to test ngx_exiting as well.

12 years agoMail: fixed ngx_mail_send() (ticket #519).
Maxim Dounin [Mon, 31 Mar 2014 17:38:27 +0000 (21:38 +0400)]
Mail: fixed ngx_mail_send() (ticket #519).

12 years agoAdded #ifndef around NGX_HAVE_CASELESS_FILESYSTEM define.
Maxim Dounin [Mon, 31 Mar 2014 17:38:25 +0000 (21:38 +0400)]
Added #ifndef around NGX_HAVE_CASELESS_FILESYSTEM define.

This brings Cygwin compilation in line with other case-insensitive
systems (notably win32 and OS X) where one can force case sensitivity
using -DNGX_HAVE_CASELESS_FILESYSTEM=0.

12 years agoMp4: improved logging after adding "end" support.
Roman Arutyunyan [Mon, 31 Mar 2014 16:05:53 +0000 (20:05 +0400)]
Mp4: improved logging after adding "end" support.

Despite introducing start and end crop operations existing log
messages still mostly refer only to start.  Logging is improved
to match both cases.

New debug logging is added to track entry count in atoms after
cropping.

Two format type mismatches are fixed as well.

12 years agoMp4: fixed seeking to a track end.
Roman Arutyunyan [Mon, 31 Mar 2014 15:52:17 +0000 (19:52 +0400)]
Mp4: fixed seeking to a track end.

When "start" value is equal to a track duration the request
fails with "time is out mp4 stts" like it did before track
duration check was added.  Now such tracks are considered
short and skipped.

12 years agoSPDY: detect premature closing of stream.
Valentin Bartenev [Fri, 28 Mar 2014 16:22:57 +0000 (20:22 +0400)]
SPDY: detect premature closing of stream.

The SPDY/3.1 specification requires that the server must respond with
a 400 "Bad request" error if the sum of the data frame payload lengths
does not equal the size of the Content-Length header.

This also fixes "zero size buf in output" alert, that might be triggered
if client sends a greater than zero Content-Length header and closes
stream using the FIN flag with an empty request body.

12 years agoSPDY: fixed the DATA frame length handling in case of some errors.
Valentin Bartenev [Fri, 28 Mar 2014 16:05:07 +0000 (20:05 +0400)]
SPDY: fixed the DATA frame length handling in case of some errors.

There are a few cases in ngx_http_spdy_state_read_data() related to error
handling when ngx_http_spdy_state_skip() might be called with an inconsistent
state between *pos and sc->length, that leads to violation of frame layout
parsing and resuted in corruption of spdy connection.

Based on a patch by Xiaochen Wang.

12 years agoSPDY: better detect if headers block has wrong entries count.
Valentin Bartenev [Wed, 26 Mar 2014 14:01:11 +0000 (18:01 +0400)]
SPDY: better detect if headers block has wrong entries count.

Previously, only one case was checked: if there's more data to parse
in a r->header_in buffer, but the buffer can be filled to the end by
the last parsed entry, so we also need to check that there's no more
data to inflate.

12 years agoSPDY: detect premature end of frame while start parsing headers.
Valentin Bartenev [Wed, 26 Mar 2014 13:43:39 +0000 (17:43 +0400)]
SPDY: detect premature end of frame while start parsing headers.

12 years agoApply underscores_in_headers also to the first character.
Piotr Sikora [Mon, 24 Mar 2014 23:35:44 +0000 (16:35 -0700)]
Apply underscores_in_headers also to the first character.

Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
12 years agoIncreased default value of variables_hash_max_size.
Andrei Belov [Tue, 25 Mar 2014 14:49:28 +0000 (18:49 +0400)]
Increased default value of variables_hash_max_size.

12 years agoMp4: skipped empty stss atom table in output.
Sergey Kandaurov [Mon, 24 Mar 2014 13:55:10 +0000 (17:55 +0400)]
Mp4: skipped empty stss atom table in output.

The atom may have no data entries after cropping.

This fixes "zero size buf in output" alerts.

12 years agoRange filter: single_range flag in request.
Maxim Dounin [Fri, 21 Mar 2014 15:33:21 +0000 (19:33 +0400)]
Range filter: single_range flag in request.

If set, it means that response body is going to be in more than one buffer,
hence only range requests with a single range should be honored.

The flag is now used by mp4 and cacheable upstream responses, thus allowing
range requests of mp4 files with start/end, as well as range processing
on a first request to a not-yet-cached files with proxy_cache.

Notably this makes it possible to play mp4 files (with proxy_cache, or with
mp4 module) on iOS devices, as byte-range support is required by Apple.

12 years agoMp4: added "end" argument support.
Roman Arutyunyan [Thu, 20 Mar 2014 12:05:19 +0000 (16:05 +0400)]
Mp4: added "end" argument support.

12 years agoMp4: moved atom cropping code out of update functions.
Roman Arutyunyan [Thu, 20 Mar 2014 12:05:18 +0000 (16:05 +0400)]
Mp4: moved atom cropping code out of update functions.

It can now be reused for implementing mp4 end.

12 years agoSPDY: improved ngx_http_spdy_state_save() again.
Maxim Dounin [Wed, 19 Mar 2014 15:30:09 +0000 (19:30 +0400)]
SPDY: improved ngx_http_spdy_state_save() again.

12 years agoMacros used for initialization in ngx_http_core_init_main_conf().
Maxim Dounin [Wed, 19 Mar 2014 08:57:40 +0000 (12:57 +0400)]
Macros used for initialization in ngx_http_core_init_main_conf().

12 years agoSPDY: improved ngx_http_spdy_state_save() check.
Maxim Dounin [Wed, 19 Mar 2014 08:57:39 +0000 (12:57 +0400)]
SPDY: improved ngx_http_spdy_state_save() check.

12 years agoSPDY: macro used for recv_buffer_size initialization.
Maxim Dounin [Wed, 19 Mar 2014 08:57:32 +0000 (12:57 +0400)]
SPDY: macro used for recv_buffer_size initialization.

12 years agoVersion bump.
Maxim Dounin [Tue, 18 Mar 2014 18:05:05 +0000 (22:05 +0400)]
Version bump.

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.