Commit graph

4327 commits

Author SHA1 Message Date
Maxim Dounin
b76e7a5fea Resolver: fixed possible memory leak in ngx_resolver_create().
Found by Coverity.
2012-08-06 10:48:09 +00:00
Ruslan Ermilov
7d589ca7e2 Fixed the -p parameter handling.
Ensure that the path supplied always ends with a `/' except when empty.
An empty value now corresponds to the current directory instead of `/'.
2012-08-03 12:52:32 +00:00
Maxim Dounin
c182270293 Fixed possible use of old cached times if runtime went backwards.
If ngx_time_sigsafe_update() updated only ngx_cached_err_log_time, and
then clock was adjusted backwards, the cached_time[slot].sec might
accidentally match current seconds on next ngx_time_update() call,
resulting in various cached times not being updated.

Fix is to clear the cached_time[slot].sec to explicitly mark cached times
are stale and need updating.
2012-08-03 09:10:39 +00:00
Maxim Dounin
896fa4e441 Added "const" to ngx_memcpy() with NGX_MEMCPY_LIMIT defined.
This fixes warning produced during compilation of the ngx_http_geoip_module
due to const qualifier being discarded.
2012-08-03 09:07:30 +00:00
Maxim Dounin
f54b2fe189 Whitespace fix. 2012-08-03 09:00:25 +00:00
Ruslan Ermilov
c3b5f66bd3 Removed the need in Perl to generate ZIP archive of nginx/Windows. 2012-08-02 14:58:36 +00:00
Maxim Dounin
d60bd1af74 Win32: fixed build with Visual Studio 2005 Express.
It is available via winetricks which makes it still usable, and has
an old crtdefs.h which uses _CRT_SECURE_NO_DEPRECATE instead of
_CRT_SECURE_NO_WARNINGS to suppress warnings.

Reported by HAYASHI Kentaro,
http://mailman.nginx.org/pipermail/nginx-devel/2012-August/002542.html
2012-08-02 12:53:07 +00:00
Andrey Belov
3f34a664cb Reorder checks in ngx_shared_memory_add() for more consistent error messages. 2012-08-01 14:37:08 +00:00
Ruslan Ermilov
e6f5594097 Simplified makefile that builds CHANGES. 2012-07-31 21:49:23 +00:00
Ruslan Ermilov
4a75d569ca Version bump. 2012-07-31 21:47:56 +00:00
Ruslan Ermilov
184eb76779 Updated PCRE used for win32 builds. 2012-07-31 13:13:52 +00:00
Ruslan Ermilov
04fa4c50ec release-1.3.4 tag 2012-07-31 12:38:57 +00:00
Ruslan Ermilov
077d6724d2 nginx-1.3.4-RELEASE 2012-07-31 12:38:37 +00:00
Ruslan Ermilov
36890eb5e2 Core: ipv6only is now on by default.
There is a general consensus that this change results in better
consistency between different operating systems and differently
tuned operating systems.

Note: this changes the width and meaning of the ipv6only field
of the ngx_listening_t structure.  3rd party modules that create
their own listening sockets might need fixing.
2012-07-30 12:27:06 +00:00
Valentin Bartenev
3711aabbf2 ngx_http_find_virtual_server() should return NGX_DECLINED if virtual server not
found.
2012-07-30 11:42:03 +00:00
Maxim Dounin
eca4cb86b0 Upstream: hide_headers/pass_headers inheritance fix.
Hide headers and pass headers arrays might not be inherited correctly
into a nested location, e.g. in configuration like

    server {
        proxy_hide_header X-Foo;
        location / {
            location /nested/ {
                proxy_pass_header X-Pad;
            }
        }
    }

the X-Foo header wasn't hidden in the location /nested/.

Reported by Konstantin Svist,
http://mailman.nginx.org/pipermail/nginx-ru/2012-July/047555.html
2012-07-30 10:35:26 +00:00
Ruslan Ermilov
a2bd6b5dd6 Improved diagnostics when a directive is specified in the wrong context. 2012-07-29 19:59:06 +00:00
Ruslan Ermilov
c4fa6e1a31 Removed extraneous GCC warning flags. 2012-07-29 19:45:30 +00:00
Ruslan Ermilov
8fdddbaf59 Slight optimization in ngx_http_upstream_add(): replaced an expression
known to be constant with the constant value.
2012-07-29 19:44:09 +00:00
Ruslan Ermilov
1395be64a2 ngx_http_upstream_add() should return NULL if an error occurs. 2012-07-29 19:38:25 +00:00
Ruslan Ermilov
f275f84e9b Reduced the number of preprocessor directives. 2012-07-26 14:47:42 +00:00
Ruslan Ermilov
e629b37932 When "debug_connection" is configured with a domain name, only the first
resolved address was used.  Now all addresses will be used.
2012-07-24 17:40:06 +00:00
Ruslan Ermilov
a8ba779147 Added the Clang compiler support.
The -Werror is commented out to not break builds on Linux.
2012-07-24 15:17:03 +00:00
Ruslan Ermilov
b57d93be20 Made sure to run configure in a "C" locale.
Otherwise, we may fail to properly detect a version of compiler.
2012-07-24 15:16:09 +00:00
Ruslan Ermilov
0e5749c2fd Added a commented out -Wmissing-prototypes to CFLAGS.
It is commented out to not break builds with 3rd party modules.
2012-07-24 15:13:34 +00:00
Ruslan Ermilov
2116442078 Fixed compilation with -Wmissing-prototypes. 2012-07-24 15:09:54 +00:00
Ruslan Ermilov
a6b64ace7a Replaced a number of "else if" with "elif". 2012-07-24 15:00:42 +00:00
Maxim Dounin
ea7734fdbb Win32: fixed cpu hog after process startup failure.
If ngx_spawn_process() failed while starting a process, the process
handle was closed but left non-NULL in the ngx_processes[] array.
The handle later was used in WaitForMultipleObjects() (if there
were multiple worker processes configured and at least one worker
process was started successfully), resulting in infinite loop.

Reported by Ricardo V G:
http://mailman.nginx.org/pipermail/nginx-devel/2012-July/002494.html
2012-07-23 16:37:24 +00:00
Ruslan Ermilov
ed9c46c4cf Fixed debugging messages to account that limit_zone was renamed to limit_conn. 2012-07-20 08:21:59 +00:00
Ruslan Ermilov
d2fb59e6a8 Fixed sorting of listen addresses so that wildcard address is always at
the end (closes #187).  Failure to do so could result in several listen
sockets to be created instead of only one listening on wildcard address.

Reported by Roman Odaisky.
2012-07-17 04:47:34 +00:00
Ruslan Ermilov
9d80c31e8d Version bump. 2012-07-17 04:42:38 +00:00
Ruslan Ermilov
47a33df3cc Synchronized the license text with the FreeBSD's bsd-style-copyright. 2012-07-10 12:40:35 +00:00
Maxim Dounin
b9df52e78d release-1.3.3 tag 2012-07-10 12:20:30 +00:00
Maxim Dounin
0710b4783c nginx-1.3.3-RELEASE 2012-07-10 12:20:10 +00:00
Maxim Dounin
0ee155d244 Entity tags: empty etags handling in If-Range.
Entity tag may be of length 2 as per RFC 2616, i.e. double quotes only.
Pointed out by Ruslan Ermilov.
2012-07-09 17:04:37 +00:00
Maxim Dounin
924cb17b60 Entity tags: the "etag" directive.
It allows to disable generation of nginx's own entity tags, while
still handling ETags in cache properly.  This may be useful e.g.
if one want to serve static files from servers with different ETag
generation algorithms.
2012-07-09 14:53:42 +00:00
Maxim Dounin
8e303db828 Entity tags: set for static respones. 2012-07-09 00:13:06 +00:00
Maxim Dounin
1d6020921e Entity tags: handling in add_header.
Notably this allows to clear ETag if one want to for some reason.
2012-07-07 21:24:01 +00:00
Maxim Dounin
9a59a5d4f6 Entity tags: clear on entity changes. 2012-07-07 21:22:27 +00:00
Maxim Dounin
4933ade4e2 Entity tags: support in If-Range header. 2012-07-07 21:21:15 +00:00
Maxim Dounin
27435f7124 Entity tags: basic support in not modified filter.
This includes handling of ETag headers (if present in a response) with
basic support for If-Match, If-None-Match conditionals in not modified
filter.

Note that the "r->headers_out.last_modified_time == -1" check in the not
modified filter is left as is intentionally.  It's to prevent handling
of If-* headers in case of proxy without cache (much like currently
done with If-Modified-Since).
2012-07-07 21:20:27 +00:00
Maxim Dounin
344cac9554 Not modified filter: tests separated from actions.
This makes code more extendable.  The only functional change is when
If-Modified-Since and If-Unmodified-Since are specified together, the
case which is explicitly left undefined by RFC 2616.  The new behaviour
is to respect them both, which seems better.
2012-07-07 21:18:30 +00:00
Maxim Dounin
cbdd6b4c1d Added Last-Modified parsing in add_header.
This allows to use last modified time set in If-Range checks.  Code
simplified to improve readability.
2012-07-07 21:16:51 +00:00
Maxim Dounin
4d3cb3aa06 Fixed If-Range with unknown last modified time.
If modification time isn't known, skip range processing and return full
entity body instead of just ignoring If-Range.  Ignoring If-Range isn't
safe as client will assume entity wasn't changed since time specified.
2012-07-07 21:16:21 +00:00
Maxim Dounin
1c6b7b24b2 Configure: fixed "make" used instead of "${MAKE}". 2012-07-07 09:35:30 +00:00
Andrey Belov
aff2878083 Corrected $request_length calculation for pipelined requests. 2012-07-06 04:27:06 +00:00
Ruslan Ermilov
9f054becb3 Fixed typo in a function name. 2012-07-03 13:06:40 +00:00
Ruslan Ermilov
718505bcd7 Made sure to initialize the entire "struct flock" allocated on stack. 2012-07-03 13:05:18 +00:00
Maxim Dounin
4c40827b6f Reset r->uri_changed in a named location (ticket #184). 2012-07-03 11:30:05 +00:00
Maxim Dounin
ac789f385c Typo fixed. 2012-07-03 11:28:54 +00:00