Compare commits

...

145 Commits

Author SHA1 Message Date
Maxim Dounin f45e2b4360 release-1.0.15 tag 2012-04-12 13:01:17 +00:00
Maxim Dounin 225229c1ba nginx-1.0.15-RELEASE 2012-04-12 13:00:53 +00:00
Maxim Dounin dc86cb5766 Merge of r4578, r4579, r4580, r4586: mp4 fixes. 2012-04-12 12:55:43 +00:00
Maxim Dounin 463bfad07e Version bump. 2012-04-12 12:47:36 +00:00
Maxim Dounin 49b24fcf2e release-1.0.14 tag 2012-03-15 11:51:16 +00:00
Maxim Dounin eba484468f nginx-1.0.14-RELEASE 2012-03-15 11:50:53 +00:00
Maxim Dounin d6c037668f Updated OpenSSL and PCRE used for win32 builds. 2012-03-15 11:46:29 +00:00
Maxim Dounin 7b781638e8 Merge of r4530, r4531: null character fixes.
*) Fixed incorrect ngx_cpystrn() usage in ngx_http_*_process_header().

   This resulted in a disclosure of previously freed memory if upstream
   server returned specially crafted response, potentially exposing
   sensitive information.

   Reported by Matthew Daley.

*) Headers with null character are now rejected.

   Headers with NUL character aren't allowed by HTTP standard and may cause
   various security problems.  They are now unconditionally rejected.
2012-03-15 11:41:43 +00:00
Maxim Dounin d5efcac176 Version bump. 2012-03-15 11:37:11 +00:00
Maxim Dounin bc95a96367 release-1.0.13 tag 2012-03-05 15:20:15 +00:00
Maxim Dounin 9787b85c48 nginx-1.0.13-RELEASE 2012-03-05 15:19:49 +00:00
Maxim Dounin f0db59f1a7 Merge of r4500: fixed spelling in single-line comments. 2012-03-05 13:26:40 +00:00
Maxim Dounin 8762382663 Merge of r4499: workaround for fs_size on ZFS (ticket #46).
ZFS reports incorrect st_blocks until file settles on disk, and this
may take a while (i.e. just after creation of a file the st_blocks value
is incorrect).  As a workaround we now use st_blocks only if
st_blocks * 512 > st_size, this should fix ZFS problems while still
preserving accuracy for other filesystems.

The problem had appeared in r3900 (1.0.1).
2012-03-05 13:20:40 +00:00
Maxim Dounin 02b4f0abed Merge of r4498:
Fix of rbtree lookup on hash collisions.

Previous code incorrectly assumed that nodes with identical keys are linked
together.  This might not be true after tree rebalance.

Patch by Lanshun Zhou.
2012-03-05 13:17:56 +00:00
Maxim Dounin 0275596328 Merge of r4497:
Fixed null pointer dereference in resolver (ticket #91).

The cycle->new_log.file may not be set before config parsing finished if
there are no error_log directive defined at global level.  Fix is to
copy it after config parsing.

Patch by Roman Arutyunyan.
2012-03-05 13:06:29 +00:00
Maxim Dounin f6df207840 Merge of r4491, r4492:
*) Renamed constants and fixed off-by-one error in "msie_padding on"
   handling.

*) Added support for the 307 Temporary Redirect.
2012-03-05 13:03:39 +00:00
Maxim Dounin 9bf9bc0db4 Merge of r4474, r4493: configure/build fixes.
*) Fixed build with embedded perl and --with-openssl.

*) Configure: moved icc detection before gcc.  New versions of icc
   confuse auto/cc/name due to introduced handling of a "icc -v".
2012-03-05 12:58:10 +00:00
Maxim Dounin 70573cf4db Merge of r4473:
Core: protection from cycles with named locations and post_action.

Now redirects to named locations are counted against normal uri changes
limit, and post_action respects this limit as well.  As a result at least
the following (bad) configurations no longer trigger infinite cycles:

1. Post action which recursively triggers post action:

    location / {
        post_action /index.html;
    }

2. Post action pointing to nonexistent named location:

    location / {
        post_action @nonexistent;
    }

3. Recursive error page for 500 (Internal Server Error) pointing to
   a nonexistent named location:

    location / {
        recursive_error_pages on;
        error_page 500 @nonexistent;
        return 500;
    }
2012-03-05 12:49:32 +00:00
Maxim Dounin 80c9a0548b Merge of r4471:
Variables: honor no_cacheable for not_found variables.

Variables with the "not_found" flag set follow the same rules as ones with
the "valid" flag set.  Make sure ngx_http_get_flushed_variable() will flush
non-cacheable variables with the "not_found" flag set.

This fixes at least one known problem with $args not available in a subrequest
(with args) when there were no args in the main request and $args variable was
queried in the main request (reported by Laurence Rowe aka elro on irc).

Also this eliminates unneeded call to ngx_http_get_indexed_variable() in
cacheable case (as it will return cached value anyway).
2012-03-05 12:36:51 +00:00
Maxim Dounin a591ee159a Merge of r4470:
Fix for proxy_store leaving temporary files for subrequests.

Temporary files might not be removed if the "proxy_store" or "fastcgi_store"
directives were used for subrequests (e.g. ssi includes) and client closed
connection prematurely.

Non-active subrequests are finalized out of the control of the upstream
module when client closes a connection.  As a result, the code to remove
unfinished temporary files in ngx_http_upstream_process_request() wasn't
executed.

Fix is to move relevant code into ngx_http_upstream_finalize_request() which
is called in all cases, either directly or via the cleanup handler.
2012-03-05 12:33:06 +00:00
Maxim Dounin c13df9cd39 Merge of r4468:
Removed r->cache/r->cached dependencies in range filter.  This is
a layering violation, use correct offset calculations instead.
2012-03-05 12:24:18 +00:00
Maxim Dounin a5579fdaff Merge of r4461: upstream: fixed "too big header" check.
If header filter postponed processing of a header by returning NGX_AGAIN
and not moved u->buffer->pos, previous check incorrectly assumed there
is additional space and did another recv() with zero-size buffer.  This
resulted in "upstream prematurely closed connection" error instead
of correct "upstream sent too big header" one.

Patch by Feibo Li.
2012-03-05 12:15:02 +00:00
Maxim Dounin e88e3cafaf Merge of r4460: ngx_ncpu detection for most *nix platforms.
This inaccurate detection by using sysconf(_SC_NPROCESSORS_ONLN) can improve
usage of the mutex lock optimization on multicore systems.
2012-03-05 12:10:09 +00:00
Maxim Dounin 756eb5325e Merge of r4423: fixed proxy_redirect off inheritance. 2012-03-05 11:47:25 +00:00
Maxim Dounin b1bc2a641e Version bump. 2012-03-05 11:36:21 +00:00
Maxim Dounin ae0f88668a release-1.0.12 tag 2012-02-06 14:09:16 +00:00
Maxim Dounin 8d8ccfc7b0 nginx-1.0.12-RELEASE 2012-02-06 14:08:59 +00:00
Maxim Dounin 9a23335abe Updated libs used for win32 builds. 2012-02-06 11:40:10 +00:00
Maxim Dounin 11006b8d5b Merge of r4422:
Fixed error handling in ngx_event_connect_peer().

Previously if ngx_add_event() failed a connection was freed two times (once
in the ngx_event_connect_peer(), and again by a caller) as pc->connection was
left set.  Fix is to always use ngx_close_connection() to close connection
properly and set pc->connection to NULL on errors.

Patch by Piotr Sikora.
2012-02-05 20:06:50 +00:00
Maxim Dounin 39a288282c Merge of r4416:
Fixed AIO error handling on FreeBSD.

The aio_return() must be called regardless of the error returned by
aio_error().  Not calling it resulted in various problems up to segmentation
faults (as AIO events are level-triggered and were reported again and again).

Additionally, in "aio sendfile" case r->blocked was incremented in case of
error returned from ngx_file_aio_read(), thus causing request hangs.
2012-02-05 20:05:11 +00:00
Maxim Dounin 0323c6f524 Merge of r4406, r4413: copyrights updated. 2012-02-05 20:02:59 +00:00
Maxim Dounin f488ff8304 Merge of r4405:
Fixed division by zero exception in ngx_hash_init().

The ngx_hash_init() function did not expect call with zero elements count,
which caused FPE error on configs with an empty "types" block in http context
and "types_hash_max_size" > 10000.
2012-02-05 19:27:18 +00:00
Maxim Dounin d0fe3dd8bc Merge of r4404:
Fixed sched_setaffinity(2) to correctly pass size.

Second argument (cpusetsize) is size in bytes, not in bits.  Previously
used constant 32 resulted in reading of uninitialized memory and caused
EINVAL to be returned on some Linux kernels.
2012-02-05 19:25:24 +00:00
Maxim Dounin f00b1da7d2 Merge of r4402:
Fixed proxy_cache_use_stale in "no live upstreams" case.
2012-02-05 19:23:44 +00:00
Maxim Dounin e84fb9b4f6 Merge of r4401, r4415:
SSL changes:

*) Added support for TLSv1.1, TLSv1.2 in ssl_protocols directive.

   Support for TLSv1.1 and TLSv1.2 protocols was introduced in
   OpenSSL 1.0.1 (-beta1 was recently released).  This change makes it
   possible to disable these protocols and/or enable them without other
   protocols.

*) Removed ENGINE_load_builtin_engines() call.

   It's already called by OPENSSL_config().  Calling it again causes
   some openssl engines (notably GOST) to corrupt memory, as they don't
   expect to be created more than once.
2012-02-05 19:15:09 +00:00
Maxim Dounin 2d97c6e2db Merge of r4398:
Changed ngx_log_debugN() macros to verify the number of arguments
when built with debugging.
2012-02-05 19:06:52 +00:00
Maxim Dounin 2692849e93 Merge of r4396:
Some questionable optomizations flags for icc were removed
in order to simplify support of its future versions.
2012-02-05 19:05:06 +00:00
Maxim Dounin 4340fb3b50 Merge of r4393: zlib license file include fixed. 2012-02-05 19:03:21 +00:00
Maxim Dounin 1d018ba09e Merge of r4384, r4385:
Fixes for limit_rate:

*) Fixed throughput problems with large limit_rate.

   Previous attempt to fix this was in r1658 (0.6.18), though that one
   wasn't enough (it was a noop).

*) Fixed interaction of limit_rate and sendfile_max_chunk.

   It's possible that configured limit_rate will permit more bytes per
   single operation than sendfile_max_chunk.  To protect disk from
   takeover by a single client it is necessary to apply sendfile_max_chunk
   as a limit regardless of configured limit_rate.

   See here for report (in Russian):
   http://mailman.nginx.org/pipermail/nginx-ru/2010-March/032806.html
2012-02-05 16:12:55 +00:00
Maxim Dounin 91ca805afb Merge of r4383, r4403:
MP4 fixes:

*) Fixed mp4 if first entry in stsc was skipped (ticket #72).

   If first entry in stsc atom was skipped, and seek was to chunk
   boundary, than first_chunk in the generated stsc table wasn't
   set to 1.

*) Fixed handling of mp4 above 2G and 32bit offsets (ticket #84).
2012-02-05 15:51:20 +00:00
Maxim Dounin 4e0e62712f Merge of r4381, r4400:
Fixed limit_conn_log_level/limit_req_log_level inheritance.  The
directives did not work if there were no limit_conn/limit_req
specified on the same level.

The code for limit_conn is different in 1.0.x, conflict resolved
manually.
2012-02-05 15:47:58 +00:00
Maxim Dounin 217ccc41c5 Merge of r4379: duplicate words removed. 2012-02-05 15:34:20 +00:00
Maxim Dounin b48566c574 Merge of r4375, r4382:
SSI changes:

*) The "if" command did not work inside the "block" command and
   produced parsing errors.

*) Added regex captures support in the expression of the "if" command.
2012-02-05 14:09:46 +00:00
Maxim Dounin f6ee2be6a0 Merge of r4372, r4373, r4374:
SCGI fixes:

*) Fixed incorrect use of r->http_version in scgi module.

   The r->http_version is a version of client's request, and modules
   must not set it unless they are really willing to downgrade protocol
   version used for a response (i.e. to HTTP/0.9 if no response headers
   are available).  In neither case r->http_version may be upgraded.

   The former code downgraded response from HTTP/1.1 to HTTP/1.0 for no
   reason, causing various problems (see ticket #66).  It was also
   possible that HTTP/0.9 requests were upgraded to HTTP/1.0.

*) Removed duplicate function declaration.

*) Removed error if there is no Status header.

   The SCGI specification doesn't specify format of the response, and
   assuming CGI specs should be used there is no reason to complain.
   RFC 3875 explicitly states that "A Status header field is optional,
   and status 200 'OK' is assumed if it is omitted".
2012-02-05 13:53:50 +00:00
Maxim Dounin d750b1e99e Merge of r4339, r4340, r4341:
Cache fixes:

*) Obsolete code removed.

   The ngx_http_cache() and ngx_http_no_cache_set_slot() functions
   were replaced in 0.8.46 and no longer used since then.

*) Handling of cache files with long headers.

   There are two possible situations which can lead to this: response
   was cached with bigger proxy_buffer_size value (and nginx was
   restared since then, i.e. shared memory zone content was lost), or
   due to the race in the cache update code (see [1]) we've end up
   with fcn->body_start from a different response stored in shared
   memory zone.

*) Only complain on long locked entries.

   There have been multiple reports of cases where a real locked entry
   was removed, resulting in a segmentation fault later in a worker
   which locked the entry.  It looks like default inactive timeout isn't
   enough in real life.

   For now just ignore such locked entries, and move them to the top of
   the inactive queue to allow processing of other entries.

[1] http://mailman.nginx.org/pipermail/nginx-devel/2011-September/001287.html
2012-02-05 13:34:08 +00:00
Maxim Dounin 202244ec5e Merge of r4338:
Renamed some constants to improve readability, no functional changes.
2012-02-05 12:46:20 +00:00
Maxim Dounin 59308b99b9 Merge r4336:
Microoptimization of sendfile(2) usage under FreeBSD.

FreeBSD kernel checks headers/trailers pointer against NULL, not
corresponding count.  Passing NULL if there are no headers/trailers
helps to avoid unneeded work in kernel, as well as unexpected 0 bytes
GIO in traces.
2012-02-05 12:42:36 +00:00
Maxim Dounin ed3d2814b9 Merge of r4335:
Fixed: some of $sent_http_* variables might contain header entries
which actually wasn't sent to a client.

The ngx_http_variable_headers() and ngx_http_variable_unknown_header()
functions did not ignore response header entries with zero "hash"
field.

Thanks to Yichun Zhang (agentzh).
2012-02-05 12:37:48 +00:00
Maxim Dounin d64f9f083f Merge of r4377: configure on Solaris fixed. 2012-02-05 12:28:35 +00:00
Maxim Dounin 3b898d19e8 Merge of r4327:
Removed unused function ngx_regex_capture_count().  The function has
been unused since r3326 (0.8.25).
2012-02-04 23:28:10 +00:00
Maxim Dounin 9e51bcdadb Merge of r4306, r4320:
Protection from stale write events in epoll.

Stale write event may happen if epoll_wait() reported both read and write
events, and processing of the read event closed descriptor.
2012-02-04 23:18:12 +00:00
Maxim Dounin daed098825 Merge of r4326:
Fix for read_head with try_files and open_file_cache.

The of.read_ahead wasn't set in try_files code path, causing read_ahead
directive to be a nop if try_files and open_file_cache were used.
2012-02-04 22:30:30 +00:00
Maxim Dounin 9afbcf447d Version bump. 2012-02-04 22:23:12 +00:00
Maxim Dounin 9cccc74346 release-1.0.11 tag 2011-12-15 14:05:08 +00:00
Maxim Dounin 1985212edb nginx-1.0.11-RELEASE 2011-12-15 14:04:39 +00:00
Maxim Dounin 853864245a Merge of r4315:
Allowed add_header for proxied 206 replies.

It was working for nginx's own 206 replies as they are seen as 200 in the
headers filter module (range filter goes later in the headers filter chain),
but not for proxied replies.
2011-12-14 18:06:21 +00:00
Maxim Dounin db7394b9a5 Merge of r4313:
Added escaping of double quotes in ngx_escape_html().

Patch by Zaur Abasmirzoev.
2011-12-14 18:04:06 +00:00
Maxim Dounin ad50cf7b86 Merge of r4307:
Fix of mp4 module seeking.
2011-12-14 18:02:37 +00:00
Maxim Dounin 620810987a Merge of r4305:
Fixed segfault on ssl servers without cert with SNI (ticket #54).

Non-default servers may not have ssl context created if there are no
certificate defined.  Make sure to check if ssl context present before
using it.
2011-12-14 18:00:50 +00:00
Maxim Dounin 6b14514f95 Merge of r4298:
Fixed flv header to match specification.

Used "\x5" in 5th byte to claim presence of both audio and video.  Used
previous tag size 0 in the beginning of the flv body (bytes 10 .. 13) as
required by specification (see http://www.adobe.com/devnet/f4v.html).

Patch by Piotr Sikora.
2011-12-14 15:30:02 +00:00
Maxim Dounin de0d84a82a Merge of r4295:
Fixed incorrect counting the length of headers in a SCGI request.
2011-12-14 15:28:13 +00:00
Maxim Dounin eb797a1658 Merge of r4294:
Fixed handling of SIGWINCH/NOACCEPT signal.

After first upgrade it was ignored since r4020 (1.1.1, 1.0.9) as
ngx_daemonized wasn't set.
2011-12-14 15:25:32 +00:00
Maxim Dounin f73a105e40 Merge of r4284:
Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()
for output of ./configure options, etc., since ngx_log_stderr() output
length is limited by 2048 characters defined as NGX_MAX_ERROR_STR.
2011-12-14 15:23:23 +00:00
Maxim Dounin c982208430 Merge of r4282, r4302:
Added image/webp and video/webm MIME types.  Added svgz extension for
compressed SVG.
2011-12-14 15:16:05 +00:00
Maxim Dounin a931dc4341 Merge of r4275, r4276, r4278, r4279:
Fixes for proxy_set_header, fastcgi/scgi/uwsgi_param inheritance:

*) Fixed proxy_set_header inheritance with proxy_cache (ticket #45).

   Headers cleared with cache enabled (If-Modified-Since etc.) might be
   cleared in unrelated servers/locations without proxy_cache enabled
   if proxy_cache was used in some server/location.

   Example config which triggered the problem:

       proxy_set_header X-Test "test";
       server { location /1 { proxy_cache name; proxy_pass ... } }
       server { location /2 { proxy_pass ... } }

   Another one:

       server {
           proxy_cache name;
           location /1 { proxy_pass ... }
           location /2 { proxy_cache off; proxy_pass ... }
       }

   In both cases If-Modified-Since header wasn't sent to backend in
   location /2.

   Fix is to not modify conf->headers_source, but instead merge user-supplied
   headers from conf->headers_source and default headers (either cache or not)
   into separate headers_merged array.

*) Fixed proxy_set_header inheritance with proxy_set_body.

*) Separate functions to merge fastcgi/scgi/uwsgi params.
   No functional changes.

*) Fixed fastcgi/scgi/uwsgi_param inheritance.  The following problems were
   fixed:

   1. Directive fastcgi_cache affected headers sent to backends in unrelated
      servers / locations (see ticket #45).

   2. If-Unmodified-Since, If-Match and If-Range headers were sent to
      backends if fastcgi_cache was used.

   3. Cache-related headers were sent to backends if there were no
      fastcgi_param directives and fastcgi_cache was used at server level.
2011-12-14 15:13:25 +00:00
Maxim Dounin c2dac94b9d Merge of r4270, r4274:
Minor cleanup:

*) Changed error message to be more appropriate in the imaginary
   "open_file_cache max=0" case.

*) Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse.
2011-12-14 14:31:55 +00:00
Maxim Dounin c5bf5678a3 Merge of r4267, r4301:
Fix of the "keepalive_disable" directive.
2011-12-14 13:40:25 +00:00
Maxim Dounin 7a35eab981 Merge of r4266, r4308, r4309:
Image filter changes:

*) The "image_filter_sharpen" directive.

*) Cosmetics.

*) Fixed "rotate" to always work when combined with "resize/crop".
2011-12-14 13:37:53 +00:00
Maxim Dounin def9ecde1a Merge of r4231, r4300, r4303, r4304:
Configure/build changes and fixes:

*) Revamped "configure --help" text.

*) FreeBSD 10-current has recently gotten POSIX_FADV_* macros.
   A fix for the broken build applied.

*) AIX 7 defines sys_nerr in errno.h, therefore <errno.h> included
   in the sys_nerr test.

   When sys_nerr and _sys_nerr are missed on a particular platform
   and our euristic for a maximum errno detection applied always
   print the maximum errno number we reached instead of printing void.

   This makes possible to build nginx on AIX 7.1.

*) Made it possible to build/install from the SVN checkout.
2011-12-14 13:34:16 +00:00
Maxim Dounin a78bab3b57 Merge of r4227, r4228:
Fixed range checking for the "somaxconn" sysctl.  Fixed port range checking.
2011-12-14 13:06:45 +00:00
Maxim Dounin 509f7ae156 Merge of r4223:
FreeBSD's MALLOC_OPTIONS must be set before any malloc() call.
The bug has been introduced in r3799.
2011-12-13 19:01:10 +00:00
Maxim Dounin 8d375710c2 Merge of r4221, r4222:
Fixed unix ngx_write_chain_to_file() to return total bytes written.

Previously result of last iteration's writev() was returned.  This was
unnoticed as return value was only used if chain contained only one or
two buffers.
2011-12-13 18:59:18 +00:00
Maxim Dounin 5c5d241e48 Merge of r4217, r4218:
Fixed "expires @00h".  Fixed "expires @time" with unknown last modified
time (ticket #32).
2011-12-13 18:46:07 +00:00
Maxim Dounin 1f6eddd095 Merge of r4153:
Better handling of late upstream creation.

Configuration with duplicate upstream blocks defined after first use, i.e.
like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend { ... }
    upstream backend { ... }

now correctly results in "duplicate upstream" error.

Additionally, upstream blocks defined after first use now handle various
server directive parameters ("weight", "max_fails", etc.).  Previously
configuration like

    server {
        ...
        location / {
            proxy_pass http://backend;
        }
    }

    upstream backend {
        server 127.0.0.1 max_fails=5;
    }

incorrectly resulted in "invalid parameter "max_fails=5"" error.
2011-12-13 18:34:34 +00:00
Maxim Dounin a96d698a88 Merge of r4144:
Upstream: clearing of u->peer.connection on close.

This fixes crashes observed with some 3rd party balancer modules.  Standard
balancer modules (round-robin and ip hash) explicitly set pc->connection
(aka u->peer.connection) to NULL and aren't affected.
2011-12-13 18:30:15 +00:00
Maxim Dounin f5c8a31e98 Merge of r4001, r4002, r4008:
Manpage changes:

*) Support link.

*) Commented out reference to non-existing nginx.conf(5).

*) Rebuild manpage only if needed.
2011-12-13 18:07:52 +00:00
Maxim Dounin 701bb91e15 Merge of r4000, r4014, r4265, r4321, r4342, r4343:
Infrastructure changes:

*) Don't ignore xmllint errors.

*) Added missing dependencies for the CHANGES{,ru} targets.
   Pass string params to xsltproc.

*) Ancient incomplete ngx_http_status_module removal.

*) Compute the repository root from the checkout.

*) Fixed RELEASE target to correctly call "release" one.
2011-12-13 17:58:18 +00:00
Maxim Dounin b7d4fc139b Version bump. 2011-12-13 16:59:41 +00:00
Igor Sysoev e4715c7e9f release-1.0.10 tag 2011-11-15 08:24:10 +00:00
Igor Sysoev b2ee2d78fe nginx-1.0.10-RELEASE 2011-11-15 08:24:03 +00:00
Igor Sysoev 612bd3f998 Merge of r4283:
Fix of "Content-Length" header of MP4 response if start argument was used.

Patch by Piotr Sikora.
2011-11-14 16:14:11 +00:00
Igor Sysoev 199832cc75 Merge of r4280:
Reverted incorrect change in internal md5 (part of r3928).
2011-11-14 16:13:15 +00:00
Igor Sysoev 8b346e57ee Merge of r4268:
Fixed compression pointer processing in DNS response greater than 255 bytes.

Thanks to Ben Hawkes.
2011-11-14 16:12:25 +00:00
Igor Sysoev ad866a4e60 Version bump. 2011-11-14 15:53:35 +00:00
Igor Sysoev 631181c34f release-1.0.9 tag 2011-11-01 14:51:26 +00:00
Igor Sysoev 3de2644bf4 nginx-1.0.9-RELEASE 2011-11-01 14:51:19 +00:00
Igor Sysoev 96c920f3ad Surplus CHANGES line removal. 2011-11-01 14:39:36 +00:00
Igor Sysoev 7e06758270 Merging r4236:
Fixed documentation pointer.
2011-11-01 14:21:22 +00:00
Igor Sysoev 6155bf1ed2 Merging r4210:
Fixed utf8 decode (ticket #25).

Patch by Alexey Kuts.
2011-11-01 14:20:43 +00:00
Igor Sysoev 5d743f5d2f Merging r4209:
Skipping location rewrite phase for server null location.
2011-11-01 14:19:13 +00:00
Igor Sysoev 30c8e394bd Merging r4198:
Additional headers for proxy/fastcgi/uwsgi/scgi_ignore_headers.

Now the following headers may be ignored as well: X-Accel-Limit-Rate,
X-Accel-Buffering, X-Accel-Charset.
2011-11-01 14:18:10 +00:00
Igor Sysoev 6b06b637ce Merging r4189, r4197:
Perl related fixes:

*) Handling of Content-Encoding set from perl.

   This fixes double gzipping in case of gzip filter being enabled while perl
   returns already gzipped response.

*) Fixed macro name.
2011-11-01 14:15:42 +00:00
Igor Sysoev 8c003d705d Merging r4195, r4196:
AIO related fixes:

*) Fix for connection drops with AIO.

   Connections serving content with AIO to fast clients were dropped with
   "client timed out" messages after send_timeout from response start.

*) Fix for socket leak with "aio sendfile" and "limit_rate".

   Second aio post happened when timer set by limit_rate expired while we have
   aio request in flight, resulting in "second aio post" alert and socket leak.

   The patch adds actual protection from aio calls with r->aio already set to
   aio sendfile code in ngx_http_copy_filter().  This should fix other cases
   as well, e.g. when sending buffered to disk upstream replies while still
   talking to upstream.

   The ngx_http_writer() is also fixed to handle the above case (though it's
   mostly optimization now).
2011-11-01 14:13:25 +00:00
Igor Sysoev 58af1da61e Merging r4193, r4194:
Autoindex fixes:

*) Autoindex: escape '?' in file names.

   For files with '?' in their names autoindex generated links with '?' not
   escaped.  This resulted in effectively truncated links as '?' indicates
   query string start.

   This is an updated version of the patch originally posted at [1].  It
   introduces generic NGX_ESCAPE_URI_COMPONENT which escapes everything but
   unreserved characters as per RFC 3986.  This approach also renders unneeded
   special colon processing (as colon is percent-encoded now), it's dropped
   accordingly.

   [1] http://nginx.org/pipermail/nginx-devel/2010-February/000112.html

*) Autoindex: escape html in file names.
2011-11-01 14:09:15 +00:00
Igor Sysoev 79318b1dab Merging r4158:
Added uwsgi_buffering and scgi_buffering directives.

Patch by Peter Smit.
2011-11-01 14:04:23 +00:00
Igor Sysoev 816c6c8049 Merging r4190, r4232:
MP4 related fixes:

*) Fixing mp4 module seeking on 32-bit platforms.

*) Adding m4a and m4v MIME types (ticket #42).
2011-11-01 14:02:07 +00:00
Igor Sysoev 60fc9be85d Merging r4179, r4182, r4212:
Adding RELEASE procedure in GNUmakefile.
2011-11-01 14:00:04 +00:00
Igor Sysoev 29f1ce37cb Merging r4155, r4219, r4220, r4230:
Windows related fixes:

*) Fixed segmentation fault with empty config on Windows.
   See here for report:
   http://mailman.nginx.org/pipermail/nginx-ru/2011-September/043288.html

*) Recent SDKs allow to build IPV6 only for Windows XP or above.

*) Fixing conflict with SDK off_t definition.

*) Fix of building by Microsoft Visual C++ 10 compiler.
2011-11-01 13:56:26 +00:00
Igor Sysoev 22f9238e11 Merging r4151, r4152, r4177:
HTTP cache related fixes:

*) Cache: fix for sending of empty responses.

   Revert wrong fix for empty responses introduced in 0.8.31 and apply new
   one, rewritten to match things done by static module as close as possible.

*) Cache: fix for sending of stale responses.

   For normal cached responses ngx_http_cache_send() sends last buffer and then
   request finalized via ngx_http_finalize_request() call, i.e. everything is
   ok.

   But for stale responses (i.e. when upstream died, but we have something in
   cache) the same ngx_http_cache_send() sends last buffer, but then in
   ngx_http_upstream_finalize_request() another last buffer is send.  This
   causes duplicate final chunk to appear if chunked encoding is used (and
   resulting problems with keepalive connections and so on).

   Fix this by not sending in ngx_http_upstream_finalize_request()
   another last buffer if we know response was from cache.

*) Fixed cache bypass caching of non-cacheable replies (ticket #21).

   If cache was bypassed with proxy_cache_bypass, cache-controlling headers
   (Cache-Control, Expires) wasn't considered and response was cached even
   if it was actually non-cacheable.

   Patch by John Ferlito.
2011-11-01 13:49:31 +00:00
Igor Sysoev b1913e7397 Merging r4147, r4148, r4149, r4150, r4207:
Fixes of combination of error_page and return directives:

*) Fix for incorrect 201 replies from dav module.

   Replies with 201 code contain body, and we should clearly indicate it's
   empty if it's empty.  Before 0.8.32 chunked was explicitly disabled for
   201 replies and as a result empty body was indicated by connection close
   (not perfect, but worked).  Since 0.8.32 chunked is enabled, and this
   causes incorrect responses from dav module when HTTP/1.1 is used: with
   "Transfer-Encoding: chunked" but no chunks at all.

   Fix is to actually return empty body in special response handler instead
   of abusing r->header_only flag.

   See here for initial report:
   http://mailman.nginx.org/pipermail/nginx-ru/2010-October/037535.html

*) Fix for double content when return is used in error_page handler.

   Test case:

      location / {
          error_page 405 /nope;
          return 405;
      }

      location /nope {
          return 200;
      }

   This is expected to return 405 with empty body, but in 0.8.42+ will return
   builtin 405 error page as well (though not counted in Content-Length, thus
   breaking protocol).

   Fix is to use status provided by rewrite script execution in case
   it's less than NGX_HTTP_BAD_REQUEST even if r->error_status set.  This
   check is in line with one in ngx_http_script_return_code().

   Note that this patch also changes behaviour for "return 302 ..." and
   "rewrite ... redirect" used as error handler.  E.g.

       location / {
           error_page 405 /redirect;
           return 405;
       }

       location /redirect {
           rewrite ^ http://example.com/;
       }

   will actually return redirect to "http://example.com/" instead of builtin
   405 error page with meaningless Location header.  This looks like correct
   change and it's in line with what happens on e.g. directory redirects
   in error handlers.

*) Fix for "return 202" not discarding body.

   Big POST (not fully preread) to a

       location / {
           return 202;
       }

   resulted in incorrect behaviour due to "return" code path not calling
   ngx_http_discard_request_body().  The same applies to all "return" used
   with 2xx/3xx codes except 201 and 204, and to all "return ... text" uses.

   Fix is to add ngx_http_discard_request_body() call to
   ngx_http_send_response() function where it looks appropriate.
   Discard body call from emtpy gif module removed as it's now redundant.

   Reported by Pyry Hakulinen, see
   http://mailman.nginx.org/pipermail/nginx/2011-August/028503.html

*) Incorrect special case for "return 204" removed.

   The special case in question leads to replies without body in
   configuration like

       location / { error_page 404 /zero; return 404; }
       location /zero { return 204; }

   while replies with empty body are expected per protocol specs.

   Correct one will look like

       if (status == NGX_HTTP_NO_CONTENT) {

           rc = ngx_http_send_header(r);

           if (rc == NGX_ERROR || r->header_only) {
               return rc;
           }

           return ngx_http_send_special(r, NGX_HTTP_LAST);
       }

   though it looks like it's better to drop this special case at all.

*) Clear old Location header (if any) while adding a new one.

   This prevents incorrect behaviour when another redirect is issued within
   error_page 302 handler.
2011-11-01 13:45:33 +00:00
Igor Sysoev 35251a4b01 Merging r4132, r4134, r4143, r4183, r4191, r4199:
Various fixes related to error messages:

*) Removed old warning that suggested to use "server_name_in_redirect off"
   (now the default) in place of no longer supported "server_name *".

*) Fixing directive name in error message if types hash size is not enough.

*) Replaced "can not" with "cannot" and "could not" in a bunch of places.
   Fixed nearby grammar errors.

*) Overhauled error messages.
2011-11-01 13:24:50 +00:00
Igor Sysoev a910acd37c Merging r4034, r4186, r4187, r4229, r4235, r4237:
SSL related fixes:

*) Better handling of various per-server ssl options with SNI.

   SSL_set_SSL_CTX() doesn't touch values cached within ssl connection
   structure, it only changes certificates (at least as of now, OpenSSL
   1.0.0d and earlier).

   As a result settings like ssl_verify_client, ssl_verify_depth,
   ssl_prefer_server_ciphers are only configurable on per-socket basis while
   with SNI it should be possible to specify them different for two servers
   listening on the same socket.

   Workaround is to explicitly re-apply settings we care about from context
   to ssl connection in servername callback.

   Note that SSL_clear_options() is only available in OpenSSL 0.9.8m+.  I.e.
   with older versions it is not possible to clear ssl_prefer_server_ciphers
   option if it's set in default server for a socket.

*) Disabling SSL compression. This saves about 300K per SSL connection.
   The SSL_OP_NO_COMPRESSION option is available since OpenSSL 1.0.0.

*) Releasing memory of idle SSL connection. This saves about 34K per SSL
   connection. The SSL_MODE_RELEASE_BUFFERS option is available since
   OpenSSL 1.0.0d.

*) Decrease of log level of some SSL handshake errors.

*) Fixed segfault on configuration testing with ssl (ticket #37).

   The following config caused segmentation fault due to conf->file not
   being properly set if "ssl on" was inherited from the http level:

   http {
       ssl on;
       server {
       }
   }

*) Silently ignoring a stale global SSL error left after disabled renegotiation.
2011-11-01 13:00:30 +00:00
Igor Sysoev 1296199fde Merging r4020:
SIGWINCH/NOACCEPT signal is disabled now in non-daemon mode.
Non-daemon mode is currently used by supervisord, daemontools and so on
or during debugging. The NOACCEPT signal is only used for online upgrade
which is not supported when nginx is run under supervisord, etc.,
so this change should not break existant setups.
2011-11-01 11:26:56 +00:00
Igor Sysoev 1312192925 Merging r4017:
Move SO_ACCEPTFILTER and TCP_DEFER_ACCEPT checks into configure.

NetBSD 5.0+ has SO_ACCEPTFILTER support merged from FreeBSD, and having
accept filter check in FreeBSD-specific ngx_freebsd_config.h prevents it
from being used on NetBSD.  Therefore move the check into configure (and
do the same for Linux-specific TCP_DEFER_ACCEPT, just to be in line).
2011-11-01 11:25:15 +00:00
Igor Sysoev 7af167615d Merging r4013, r4200:
error_log related fixes:

*) Complain on invalid log levels.

   Previously only first log level was required to be correct, while
   error_log directive in fact accepts list of levels (e.g. one may
   specify "error_log ... debug_core debug_http;").  This resulted
   in (avoidable) wierd behaviour on missing semicolon after error_log
   directive, e.g.

       error_log /path/to/log info
       index index.php;

   silently skipped index directive and it's arguments (trying to
   interpret them as log levels without checking to be correct).

*) Fixed configuration summary and manpage contents for the special
   --error-log-path=stderr case.
2011-11-01 11:23:26 +00:00
Igor Sysoev 82056dfb6d Merging r4009, r4133, r4184, r4201, r4202, r4203, r4204, r4205:
Miscellaneous fixes:

*) Fix of names of the referer hash size directives introduced in r3940.

*) Cosmetics: replaced NGX_CONF_TAKE1 to NGX_CONF_FLAG for "sendfile"
   and "chunked_transfer_encoding" directives, to be in line with all
   directives taking a boolean argument.  Both flags will ensure that
   a directive takes one argument.

*) Improved ngx_parse_time() code readability.

*) Preallocating exact number of default MIME types entries.

*) Stylistic change in checking the boolean expression.

*) Replaced magic constants representing default values of some directives
   with appropriate #define's.

*) Fixed grammar in a comment.

*) Fixed two minor bugs in "types" parsing code.
2011-11-01 11:19:58 +00:00
Igor Sysoev 192cd8704d Merging r3992, r4192:
access_log related fixes:

*) Removal of error message about %name log_format parameters,
   they have been deleted long ago in 0.5.0-RELEASE.

*) Improved access log escaping to better protect other software.
   Some character sets (notably ISO-8859-1) have C1 control characters in
   upper half, make sure to escape them.
2011-11-01 11:06:31 +00:00
Igor Sysoev 28bf21f99e Version bump. 2011-11-01 10:10:50 +00:00
Igor Sysoev 920ca98c27 release-1.0.8 tag 2011-10-01 06:00:49 +00:00
Igor Sysoev 9b11d5d016 nginx-1.0.8-RELEASE 2011-10-01 06:00:42 +00:00
Igor Sysoev 526a658409 Merging r4089 missed in r4170 merge. 2011-10-01 05:37:30 +00:00
Igor Sysoev 805efdf4d7 Version bump. 2011-10-01 05:35:34 +00:00
Igor Sysoev 5b8d8038ef release-1.0.7 tag 2011-09-30 15:35:30 +00:00
Igor Sysoev 0bef326515 nginx-1.0.7-RELEASE 2011-09-30 15:35:23 +00:00
Igor Sysoev 1ab2343cc4 Merging r4086, r4087, r4088, r4090, r4094, r4095, r4096, r4097, r4099, r4100,
r4106, r4107, r4108, r4113, r4156, r4157:

*) ngx_http_mp4_module.
*) "video/mp4" mime type added.
2011-09-30 15:13:47 +00:00
Igor Sysoev a92fa3b1db Merging r3986, r4006, r4007, r4073:
Request body related fixes:

*) Always set timer in discard body handler, this fixes the cases
when request for static file is redirected by error_page to an SSI page.

*) Correctly set body if it's preread and there are extra data.

Previously all available data was used as body, resulting in garbage after
real body e.g. in case of pipelined requests.  Make sure to use only as many
bytes as request's Content-Length specifies.

*) Fix body with request_body_in_single_buf.

If there were preread data and request body was big enough first part
of the request body was duplicated.

See report here:
http://mailman.nginx.org/pipermail/nginx/2011-July/027756.html

*) Bugfix: read event was not blocked after reading body.

Read event should be blocked after reading body, else undefined behaviour
might occur on additional client activity.  This fixes segmentation faults
observed with proxy_ignore_client_abort set.
2011-09-30 14:36:19 +00:00
Igor Sysoev 4f1f650ef2 Merging r4011, r4012, r4136:
Proxy related fixes:

*) Fixing cpu hog with all upstream servers marked "down".

The following configuration causes nginx to hog cpu due to infinite loop
in ngx_http_upstream_get_peer():

    upstream backend {
        server 127.0.0.1:8080 down;
        server 127.0.0.1:8080 down;
    }

    server {
       ...
       location / {
           proxy_pass http://backend;
       }
    }

Make sure we don't loop infinitely in ngx_http_upstream_get_peer() but stop
after resetting peer weights once.

Return 0 if we are stuck.  This is guaranteed to work as peer 0 always exists,
and eventually ngx_http_upstream_get_round_robin_peer() will do the right
thing falling back to backup servers or returning NGX_BUSY.

*) Upstream: properly allocate memory for tried flags.

Previous allocation only took into account number of non-backup servers, and
this caused memory corruption with many backup servers.

See report here:
http://mailman.nginx.org/pipermail/nginx/2011-May/026531.html

*) Fix of cpu hog in event pipe.

If client closed connection in ngx_event_pipe_write_to_downstream(), buffers
in the "out" chain were lost.  This caused cpu hog if all available buffers
were in the "out" chain.  Fix is to call ngx_chain_update_chains() before
checking return code of output filter to avoid loosing buffers in the "out"
chain.

Note that this situation (all available buffers in the "out" chain) isn't
normal, it should be prevented by busy buffers limit.  Though right now it
may happen with complex protocols like fastcgi.  This should be addressed
separately.
2011-09-30 14:30:01 +00:00
Igor Sysoev 62e45cf0ab Merging r4114, r4129:
Buffers reuse in chunked filter.

There were 2 buffers allocated on each buffer chain sent through chunked
filter (one buffer for chunk size, another one for trailing CRLF, about
120 bytes in total on 32-bit platforms).  This resulted in large memory
consumption with long-lived requests sending many buffer chains.  Usual
example of problematic scenario is streaming though proxy with
proxy_buffering set to off.

Introduced buffers reuse reduces memory consumption in the above problematic
scenario.

See here for initial report:
http://mailman.nginx.org/pipermail/nginx/2010-April/019814.html
2011-09-30 14:20:52 +00:00
Igor Sysoev 3b51e822bb Merging r4137:
Fixed loss of chain links in fastcgi module.
2011-09-30 14:18:58 +00:00
Igor Sysoev eb88e0b937 Merging r4130, r4131, r4135:
Linux AIO related fixes:

*) Fixing Linux AIO syscalls return value handling:
syscall(2) uses usual libc convention, it returns -1 on error and
sets errno. Obsolete _syscall(2) returns negative value of error.

*) Fixing Linux AIO initiatialization: AIO operations are disabled
if kernel does not support them.  Previously worker just exited.

*) The "worker_aio_requests" directive.

The default value is 32 AIO simultaneous requests per worker. Previously
they were hardcoded to 1024, and it was too large, since Linux allocated
them early on io_setup(), but not on request itself. So with default value
of /proc/sys/fs/aio-max-nr equal to 65536 only 64 worker processes could
be run simultaneously. 32 AIO requests are enough for modern disks even if
server runs only 1 worker.
2011-09-30 14:12:53 +00:00
Igor Sysoev c7bc53943d Merging r4098:
In Mac OS X Lion, Apple deprecated the use of the system OpenSSL library
in favour of their CommonCrypto library.  This change adds a work-around
that allows nginx to still be built on Lion with OpenSSL.
2011-09-30 14:09:44 +00:00
Igor Sysoev 1ab0b45def Merging r4036, r4055, r4056, r4057, r4058, r4059, r4060, r4061, r4062, r4063,
r4064:

Ranges related fixes:

The "max_ranges" directive.
"max_ranges 0" disables ranges support at all,
"max_ranges 1" allows the single range, etc.
By default number of ranges is unlimited, to be precise, 2^31-1.

If client requests more ranges than "max_ranges" permits,
nginx disables ranges and returns just the source response.

If total size of all ranges is greater than source response size,
then nginx disables ranges and returns just the source response.
This fix should not affect well-behaving applications but will defeat
DoS attempts exploiting malicious byte ranges.

Now unsatisfiable ranges are processed according to RFC 2616.
2011-09-30 14:06:08 +00:00
Igor Sysoev 6ecb4fc5c0 Merging r4077, r4101, r4102:
open_file_cache related fixes:

*) Bugfix: open_file_cache lost is_directio flag.

On file retest open_file_cache lost is_directio if file wasn't changed.
This caused unaligned operations under Linux to fail with EINVAL.
It wasn't noticeable with AIO though, as errors wasn't properly logged.

*) Bugfix: open_file_cache did not update file info on retest.

If file inode was not changed, cached file information was not updated
on retest.  As a result stale information might be cached forever if file
attributes was changed and/or file was extended.
2011-09-30 13:57:44 +00:00
Igor Sysoev 23aceec62e Merging r4010, r4065:
SSL related fixes:

*) Fixing proxy_set_body and proxy_pass_request_body with SSL.

Flush flag wasn't set in constructed buffer and this prevented any data
from being actually sent to upstream due to SSL buffering.  Make sure
we always set flush in the last buffer we are going to sent.

See here for report:
http://nginx.org/pipermail/nginx-ru/2011-June/041552.html

*) Proper SSL shutdown handling.

If connection has unsent alerts, SSL_shutdown() tries to send them even
if SSL_set_shutdown(SSL_RECEIVED_SHUTDOWN|SSL_SENT_SHUTDOWN) was used.
This can be prevented by SSL_set_quiet_shutdown().  SSL_set_shutdown()
is required nevertheless to preserve session.
2011-09-30 13:42:59 +00:00
Igor Sysoev 31a47bc963 Merging r3933, r4154:
A new fix for the case when ssl_session_cache defined, but ssl is not
enabled in any server. The previous r1033 does not help when unused zone
becomes used after reconfiguration, so it is backed out.

The initial thought was to make SSL modules independed from SSL implementation
and to keep OpenSSL code dependance as much as in separate files.
2011-09-30 13:36:33 +00:00
Igor Sysoev e45a617c7b Version bump. 2011-09-30 13:24:49 +00:00
Igor Sysoev 7e6ba956df Fix of release date. 2011-08-29 14:43:51 +00:00
Igor Sysoev cfa940cfea release-1.0.6 tag 2011-08-29 14:28:31 +00:00
Igor Sysoev 7916dd297a nginx-1.0.6-RELEASE 2011-08-29 14:28:23 +00:00
Igor Sysoev 2a8f8a74e6 Merge of r4016:
Fix ignored headers handling in fastcgi/scgi/uwsgi.

The bug had appeared in r3561 (fastcgi), r3638 (scgi), r3567 (uwsgi).
2011-08-29 14:13:46 +00:00
Igor Sysoev f9d38150d3 Getting rid of " <br/>" hacks. 2011-08-29 14:03:06 +00:00
Igor Sysoev 62b51752a2 CHANGES conversion from KOI8-R to UTF-8. 2011-08-29 14:02:15 +00:00
Igor Sysoev eb9146d1be Merge of r3996, r3998, r4015, r4023, r4025, r4026, r4027:
Changes log build procedure fixes:

*) using sed instead of perl
*) support <br/> in the middle of input
*) fixed "<br>" lookup (eliminates the need in " <br/>" hacks)
*) fixed maximum length for unbreakable input
*) fixed space lookup (allows a space at column 77 to break a line)
*) traling spaces removal in text CHANGES files.
2011-08-29 13:57:43 +00:00
Igor Sysoev 3648d88432 Merge of r4018:
Fix buffer overrun under Windows.
2011-08-29 13:11:47 +00:00
Igor Sysoev 5f593bbc51 Merge of r3964, r3977, r3978:
Proxy related fixes:

*) finalizing with rc == 0 in unbuffered proxy mode caused nginx to wait
   for another send_timeout before actually closing client's connection
   if client timed out while still talking to upstream server
*) update r3945 with more descriptive error message
*) test length of proxy_pass with variables;
   patch by Lanshun Zhou
2011-08-29 12:56:09 +00:00
Igor Sysoev c68a6190fc Merge of r4004, r4005:
Solaris related fixes:

*) Detect POSIX semaphores in librt on Solaris (ticket #3).
   Patch by Denis Ivanov.
*) Lower optimization level for Sun Studio before 12.1.
   At least Sun Studio 12 has problems with bit-fields exposed by nginx code
   (caught by test suite).  They seems to be fixed in Sun Studio 12.1.  As a
   workaround use "-fast -xalias_level=any" for older versions, it resolves
   the problem.
2011-08-29 12:50:35 +00:00
Igor Sysoev b7bac8c9f9 Merge of r4003:
Configure: catch up with new Linux version numbering (ticket #5).

Catch up with new Linux version numbering scheme as announced at [1] and
suppress unrecognized versions to actually use default 0.

[1] https://lkml.org/lkml/2011/5/29/204
2011-08-29 12:47:32 +00:00
Igor Sysoev b0e9b07a39 Merge of r3982, r3984, r3985, r3991:
Lingering closing related fixes:

*) lingering_close "off|on|always"
*) enable lingering close for pipelined requests
*) do not send RST on normal lingering close read timeout,
   if reset_timedout_connection is on
2011-08-29 12:45:03 +00:00
Igor Sysoev 2d6041994f Merge of r3960, r3961, r3962, r3963, r3965:
SSL related fixes:

*) MSIE export versions are rare now, so RSA 512 key is generated on demand
   and is shared among all hosts instead of pregenerating for every HTTPS host
   on configuraiton phase. This decreases start time for configuration with
   large number of HTTPS hosts.
*) ECDHE support; patch by Adrian Kotelba
*) fix build by gcc46 with -Wunused-value option
*) fix SSL connection issues on platforms with 32-bit off_t
*) do not try to reuse and save a SSL session for a peer created on the fly
   by ngx_http_upstream_create_round_robin_peer(), since the peer lives
   only during request so the saved SSL session will never be used again
   and just causes memory leak
2011-08-29 12:35:53 +00:00
Igor Sysoev 951bdd4c70 Merge of r3979, r3980, r3981, r3983, r3987, r3994, r3995:
Accept-Encoding refactoring:
*) "gzip; q=0" support
*) and removal of ancient MSIE 4.x test for gzip
2011-08-29 10:39:23 +00:00
Igor Sysoev 9ba764fd7b Merge of r3972, r3973, r3974:
Cache fixes:

*) do not close connection if cache file is too small: replace it with
   valid one
*) rename ngx_http_file_cache_manager_sleep() to
   ngx_http_file_cache_loader_sleep() and do not use it all in cache manager:
   this is a vestige of the times when cache manager loaded cache
*) set correct configuration file values while adding path
2011-08-29 10:07:58 +00:00
Igor Sysoev bbcdf62eb8 Merge of r3966, r3967, r3968, r3969, r3970, r3971:
Cache loader improvements:

The cache loader performs two tasks: inserting cache objects in inactivity
list and evaluating total cache size. Reading just directory is enough for
this purpose. Elimination of reading cache files saves at least one disk I/O
operation per file.
2011-08-29 09:51:56 +00:00
Igor Sysoev da5a35b5a3 Merge of r4035:
Cache size accounting fix: actual cache size on disk was less than
needed by sum of sizes of files loaded by worker processes themselves
while cache loader was running.

The bug has been introduced in r3900.
2011-08-29 09:35:00 +00:00
Igor Sysoev 692f277fcc Version bump. 2011-08-29 09:30:22 +00:00
Igor Sysoev f0c7a0cab6 stable-1.0 branch 2011-07-19 14:57:06 +00:00
372 changed files with 9583 additions and 4399 deletions

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# aCC: HP ANSI C++ B3910B A.03.55.02

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Borland C++ 5.5

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Compaq C V6.5-207

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
LINK="\$(CC)"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# gcc 2.7.2.3, 2.8.1, 2.95.4, egcs-1.1.2

View File

@ -1,8 +1,9 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Intel C++ compiler 7.1, 8.0, 8.1, 9.0
# Intel C++ compiler 7.1, 8.0, 8.1, 9.0, 11.1
NGX_ICC_VER=`$CC -V 2>&1 | grep 'Version' 2>&1 \
| sed -e 's/^.* Version \([^ ]*\) *Build.*$/\1/'`
@ -15,32 +16,7 @@ have=NGX_COMPILER value="\"Intel C Compiler $NGX_ICC_VER\"" . auto/define
# optimizations
CFLAGS="$CFLAGS -O"
# inline the functions declared with __inline
#CFLAGS="$CFLAGS -Ob1"
# inline any function, at the compiler's discretion
CFLAGS="$CFLAGS -Ob2"
# multi-file IP optimizations
case "$NGX_ICC_VER" in
9.*)
IPO="-ipo"
;;
# 8.1.38 under FreeBSD can not link -ipo
8.1)
IPO="-ip"
;;
*)
IPO="-ipo -ipo_obj"
;;
esac
# single-file IP optimizations
#IPO="-ip"
CFLAGS="$CFLAGS $IPO"
CORE_LINK="$CORE_LINK $IPO"
CORE_LINK="$CORE_LINK -opt_report_file=$NGX_OBJS/opt_report_file"
@ -64,15 +40,15 @@ esac
CFLAGS="$CFLAGS $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-O $IPO $CPU_OPT"
PCRE_OPT="-O $CPU_OPT"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-O $IPO $CPU_OPT"
MD5_OPT="-O $CPU_OPT"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-O $IPO $CPU_OPT"
ZLIB_OPT="-O $CPU_OPT"
fi

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# MSVC 6.0 SP2

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ "$NGX_PLATFORM" != win32 ]; then
@ -25,6 +26,13 @@ fi
if [ "$CC" = cl ]; then
if `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16' \
>/dev/null 2>&1`; then
NGX_CC_NAME=msvc10
echo " + using Microsoft Visual C++ 10 compiler"
else if `$NGX_WINE $CC -v 2>&1 \
| grep '^Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14' \
>/dev/null 2>&1`; then
@ -43,6 +51,7 @@ if [ "$CC" = cl ]; then
echo " + using Microsoft Visual C++ compiler"
fi
fi
fi
else
if [ "$CC" = wcl386 ]; then
@ -54,16 +63,16 @@ if [ "$CC" = bcc32 ]; then
NGX_CC_NAME=bcc
echo " + using Borland C++ compiler"
else
if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
NGX_CC_NAME=gcc
echo " + using GNU C compiler"
else
if `$CC -V 2>&1 | grep '^Intel(R) C' >/dev/null 2>&1`; then
NGX_CC_NAME=icc
echo " + using Intel C++ compiler"
else
if `$CC -v 2>&1 | grep 'gcc version' >/dev/null 2>&1`; then
NGX_CC_NAME=gcc
echo " + using GNU C compiler"
else
if `$CC -V 2>&1 | grep 'Sun C' >/dev/null 2>&1`; then
NGX_CC_NAME=sunc

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Open Watcom C 1.0, 1.2, 1.3

View File

@ -1,11 +1,14 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
# Sun C 5.7 Patch 117837-04 2005/05/11 Sun Studio 10
# Sun C 5.8 2005/10/13 Sun Studio 11
# Sun C 5.9 SunOS_i386 2007/05/03 Sun Studio 12
# Sun C 5.9 SunOS_sparc 2007/05/03
# Sun C 5.10 SunOS_i386 2009/06/03 Sun Studio 12.1
# Sun C 5.11 SunOS_i386 2010/08/13 Sun Studio 12.2
NGX_SUNC_VER=`$CC -V 2>&1 | grep 'Sun C' 2>&1 \
| sed -e 's/^.* Sun C \(.*\)/\1/'`
@ -57,9 +60,19 @@ esac
# optimizations
# 20736 == 0x5100, Sun Studio 12.1
if [ "$ngx_sunc_ver" -ge 20736 ]; then
ngx_fast="-fast"
else
# older versions had problems with bit-fields
ngx_fast="-fast -xalias_level=any"
fi
IPO=-xipo
CFLAGS="$CFLAGS -fast $IPO"
CORE_LINK="$CORE_LINK -fast $IPO"
CFLAGS="$CFLAGS $ngx_fast $IPO"
CORE_LINK="$CORE_LINK $ngx_fast $IPO"
case $CPU in
@ -126,15 +139,15 @@ CFLAGS="$CFLAGS $CPU_OPT"
if [ ".$PCRE_OPT" = "." ]; then
PCRE_OPT="-fast $IPO $CPU_OPT"
PCRE_OPT="$ngx_fast $IPO $CPU_OPT"
fi
if [ ".$MD5_OPT" = "." ]; then
MD5_OPT="-fast $IPO $CPU_OPT"
MD5_OPT="$ngx_fast $IPO $CPU_OPT"
fi
if [ ".$ZLIB_OPT" = "." ]; then
ZLIB_OPT="-fast $IPO $CPU_OPT"
ZLIB_OPT="$ngx_fast $IPO $CPU_OPT"
fi

1
auto/configure vendored
View File

@ -1,6 +1,7 @@
#!/bin/sh
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
. auto/options

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for system endianess ...$ngx_c"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_feature ...$ngx_c"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_HEADERS_H

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_include="unistd.h"; . auto/include

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_include ...$ngx_c"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
NGX_MAKEFILE=$NGX_OBJS/Makefile

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $USE_PERL = YES ]; then
@ -53,7 +54,7 @@ esac
case ".$NGX_ERROR_LOG_PATH" in
./*)
./* | .)
;;
*)
@ -72,14 +73,28 @@ case ".$NGX_HTTP_LOG_PATH" in
esac
if test -f man/nginx.8 ; then
NGX_MAN=man/nginx.8
else
NGX_MAN=docs/man/nginx.8
fi
if test -d html ; then
NGX_HTML=html
else
NGX_HTML=docs/html
fi
cat << END >> $NGX_MAKEFILE
manpage:
manpage: $NGX_OBJS/nginx.8
$NGX_OBJS/nginx.8: $NGX_MAN $NGX_AUTO_CONFIG_H
sed -e "s|%%PREFIX%%|$NGX_PREFIX|" \\
-e "s|%%PID_PATH%%|$NGX_PID_PATH|" \\
-e "s|%%CONF_PATH%%|$NGX_CONF_PATH|" \\
-e "s|%%ERROR_LOG_PATH%%|$NGX_ERROR_LOG_PATH|" \\
< man/nginx.8 > $NGX_OBJS/nginx.8
-e "s|%%ERROR_LOG_PATH%%|${NGX_ERROR_LOG_PATH:-stderr}|" \\
< $NGX_MAN > \$@
install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
$NGX_INSTALL_PERL_MODULES
@ -133,11 +148,11 @@ install: $NGX_OBJS${ngx_dirsep}nginx${ngx_binext} \
mkdir -p '\$(DESTDIR)`dirname "$NGX_HTTP_LOG_PATH"`'
test -d '\$(DESTDIR)$NGX_PREFIX/html' \
|| cp -r html '\$(DESTDIR)$NGX_PREFIX'
|| cp -R $NGX_HTML '\$(DESTDIR)$NGX_PREFIX'
END
if test -n "\$(DESTDIR)$NGX_ERROR_LOG_PATH"; then
if test -n "$NGX_ERROR_LOG_PATH"; then
cat << END >> $NGX_MAKEFILE
test -d '\$(DESTDIR)`dirname "$NGX_ERROR_LOG_PATH"`' || \

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $USE_PCRE = YES -o $PCRE != NONE ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="GeoIP library"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="Google perftools"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $NGX_LIBATOMIC != YES ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_MAKEFILE

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="GD library"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
ngx_feature="libxslt"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $PCRE != NONE -a $PCRE != NO -a $PCRE != YES ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $MD5 != NONE ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
case "$NGX_CC_NAME" in

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $OPENSSL != NONE ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
case "$CC" in

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
all:

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
all:

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $PCRE != NONE ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
case "$NGX_CC_NAME" in

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -q -O2 -tWM -w-8004 $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -c -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo "checking for perl"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_MAKEFILE
@ -27,6 +28,7 @@ $NGX_OBJS/src/http/modules/perl/Makefile: \
&& NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \
NGX_PCRE=$PCRE \
NGX_OBJS=$NGX_OBJS \
NGX_OPENSSL=$OPENSSL \
$NGX_PERL Makefile.PL \
LIB=$NGX_PERL_MODULES \
INSTALLSITEMAN3DIR=$NGX_PERL_MODULES_MAN

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $SHA1 != NONE ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
case "$NGX_CC_NAME" in

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -q -O2 -tWM $(CPU_OPT) -DL_ENDIAN

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -zq -bt=nt -bm -ot -op -oi -oe -s $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_lib ...$ngx_c"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $ZLIB != NONE ]; then

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
case "$NGX_CC_NAME" in

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -q -O2 -tWM -w-8004 -w-8012 $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CFLAGS = -zq -bt=nt -ot -op -oi -oe -s -bm $(CPU_OPT)

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo "creating $NGX_MAKEFILE"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
if [ $EVENT_SELECT = NO -a $EVENT_FOUND = NO ]; then
@ -334,6 +335,11 @@ if [ $HTTP_FLV = YES ]; then
HTTP_SRCS="$HTTP_SRCS $HTTP_FLV_SRCS"
fi
if [ $HTTP_MP4 = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_MP4_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_MP4_SRCS"
fi
if [ $HTTP_UPSTREAM_IP_HASH = YES ]; then
HTTP_MODULES="$HTTP_MODULES $HTTP_UPSTREAM_IP_HASH_MODULE"
HTTP_SRCS="$HTTP_SRCS $HTTP_UPSTREAM_IP_HASH_SRCS"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
help=no
@ -92,6 +93,7 @@ HTTP_BROWSER=YES
HTTP_SECURE_LINK=NO
HTTP_DEGRADATION=NO
HTTP_FLV=NO
HTTP_MP4=NO
HTTP_GZIP_STATIC=NO
HTTP_UPSTREAM_IP_HASH=YES
@ -201,6 +203,7 @@ do
--with-http_sub_module) HTTP_SUB=YES ;;
--with-http_dav_module) HTTP_DAV=YES ;;
--with-http_flv_module) HTTP_FLV=YES ;;
--with-http_mp4_module) HTTP_MP4=YES ;;
--with-http_gzip_static_module) HTTP_GZIP_STATIC=YES ;;
--with-http_random_index_module) HTTP_RANDOM_INDEX=YES ;;
--with-http_secure_link_module) HTTP_SECURE_LINK=YES ;;
@ -302,21 +305,21 @@ if [ $help = yes ]; then
cat << END
--help this message
--help print this message
--prefix=PATH set the installation prefix
--sbin-path=PATH set path to the nginx binary file
--conf-path=PATH set path to the nginx.conf file
--error-log-path=PATH set path to the error log
--pid-path=PATH set path to nginx.pid file
--lock-path=PATH set path to nginx.lock file
--prefix=PATH set installation prefix
--sbin-path=PATH set nginx binary pathname
--conf-path=PATH set nginx.conf pathname
--error-log-path=PATH set error log pathname
--pid-path=PATH set nginx.pid pathname
--lock-path=PATH set nginx.lock pathname
--user=USER set non-privilege user
for the worker processes
--group=GROUP set non-privilege group
for the worker processes
--user=USER set non-privileged user for
worker processes
--group=GROUP set non-privileged group for
worker processes
--builddir=DIR set the build directory
--builddir=DIR set build directory
--with-rtsig_module enable rtsig module
--with-select_module enable select module
@ -324,8 +327,8 @@ cat << END
--with-poll_module enable poll module
--without-poll_module disable poll module
--with-file-aio enable file aio support
--with-ipv6 enable ipv6 support
--with-file-aio enable file AIO support
--with-ipv6 enable IPv6 support
--with-http_ssl_module enable ngx_http_ssl_module
--with-http_realip_module enable ngx_http_realip_module
@ -336,6 +339,7 @@ cat << END
--with-http_sub_module enable ngx_http_sub_module
--with-http_dav_module enable ngx_http_dav_module
--with-http_flv_module enable ngx_http_flv_module
--with-http_mp4_module enable ngx_http_mp4_module
--with-http_gzip_static_module enable ngx_http_gzip_static_module
--with-http_random_index_module enable ngx_http_random_index_module
--with-http_secure_link_module enable ngx_http_secure_link_module
@ -367,17 +371,20 @@ cat << END
disable ngx_http_upstream_ip_hash_module
--with-http_perl_module enable ngx_http_perl_module
--with-perl_modules_path=PATH set path to the perl modules
--with-perl=PATH set path to the perl binary
--with-perl_modules_path=PATH set Perl modules path
--with-perl=PATH set perl binary pathname
--http-log-path=PATH set path to the http access log
--http-client-body-temp-path=PATH set path to the http client request body
temporary files
--http-proxy-temp-path=PATH set path to the http proxy temporary files
--http-fastcgi-temp-path=PATH set path to the http fastcgi temporary
files
--http-uwsgi-temp-path=PATH set path to the http uwsgi temporary files
--http-scgi-temp-path=PATH set path to the http scgi temporary files
--http-log-path=PATH set http access log pathname
--http-client-body-temp-path=PATH set path to store
http client request body temporary files
--http-proxy-temp-path=PATH set path to store
http proxy temporary files
--http-fastcgi-temp-path=PATH set path to store
http fastcgi temporary files
--http-uwsgi-temp-path=PATH set path to store
http uwsgi temporary files
--http-scgi-temp-path=PATH set path to store
http scgi temporary files
--without-http disable HTTP server
--without-http-cache disable HTTP cache
@ -393,40 +400,40 @@ cat << END
--add-module=PATH enable an external module
--with-cc=PATH set path to C compiler
--with-cpp=PATH set path to C preprocessor
--with-cc-opt=OPTIONS set additional options for C compiler
--with-ld-opt=OPTIONS set additional options for linker
--with-cpu-opt=CPU build for specified CPU, the valid values:
--with-cc=PATH set C compiler pathname
--with-cpp=PATH set C preprocessor pathname
--with-cc-opt=OPTIONS set additional C compiler options
--with-ld-opt=OPTIONS set additional linker options
--with-cpu-opt=CPU build for the specified CPU, valid values:
pentium, pentiumpro, pentium3, pentium4,
athlon, opteron, sparc32, sparc64, ppc64
--without-pcre disable PCRE library usage
--with-pcre force PCRE library usage
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional options for PCRE building
--with-pcre-opt=OPTIONS set additional build options for PCRE
--with-md5=DIR set path to md5 library sources
--with-md5-opt=OPTIONS set additional options for md5 building
--with-md5-opt=OPTIONS set additional build options for md5
--with-md5-asm use md5 assembler sources
--with-sha1=DIR set path to sha1 library sources
--with-sha1-opt=OPTIONS set additional options for sha1 building
--with-sha1-opt=OPTIONS set additional build options for sha1
--with-sha1-asm use sha1 assembler sources
--with-zlib=DIR set path to zlib library sources
--with-zlib-opt=OPTIONS set additional options for zlib building
--with-zlib-opt=OPTIONS set additional build options for zlib
--with-zlib-asm=CPU use zlib assembler sources optimized
for specified CPU, the valid values:
for the specified CPU, valid values:
pentium, pentiumpro
--with-libatomic force libatomic_ops library usage
--with-libatomic=DIR set path to libatomic_ops library sources
--with-openssl=DIR set path to OpenSSL library sources
--with-openssl-opt=OPTIONS set additional options for OpenSSL building
--with-openssl-opt=OPTIONS set additional build options for OpenSSL
--with-debug enable the debugging logging
--with-debug enable debug logging
END

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo "checking for $NGX_SYSTEM specific features"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_DARWIN . auto/have_headers

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_FREEBSD . auto/have_headers

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_LINUX . auto/have_headers
@ -18,7 +19,9 @@ CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
# Linux kernel version
version=$((`uname -r \
| sed 's/^\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1*256*256+\2*256+\3/'`))
| sed -n -e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/ \
\1*256*256+\2*256+\3/p' \
-e 's/^\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/\1*256*256+\2*256/p'`))
version=${version:-0}

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_SOLARIS . auto/have_headers

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_WIN32 . auto/have_headers

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
CORE_MODULES="ngx_core_module ngx_errlog_module ngx_conf_module"
@ -463,6 +464,10 @@ HTTP_FLV_MODULE=ngx_http_flv_module
HTTP_FLV_SRCS=src/http/modules/ngx_http_flv_module.c
HTTP_MP4_MODULE=ngx_http_mp4_module
HTTP_MP4_SRCS=src/http/modules/ngx_http_mp4_module.c
HTTP_GZIP_STATIC_MODULE=ngx_http_gzip_static_module
HTTP_GZIP_STATIC_SRCS=src/http/modules/ngx_http_gzip_static_module.c

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
have=NGX_SUPPRESS_WARN . auto/have

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
### STUB

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_type size ...$ngx_c"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for $ngx_type ...$ngx_c"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
echo $ngx_n "checking for uintptr_t ...$ngx_c"

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
cat << END >> $NGX_AUTO_CONFIG_H

View File

@ -1,5 +1,6 @@
# Copyright (C) Igor Sysoev
# Copyright (C) Nginx, Inc.
NGX_USER=${NGX_USER:-nobody}
@ -295,6 +296,7 @@ if [ $ngx_found != yes ]; then
fi
fi
ngx_feature="SO_SETFIB"
ngx_feature_name="NGX_HAVE_SETFIB"
ngx_feature_run=no
@ -305,6 +307,28 @@ ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_SETFIB, NULL, 4)"
. auto/feature
ngx_feature="SO_ACCEPTFILTER"
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)"
. auto/feature
ngx_feature="TCP_DEFER_ACCEPT"
ngx_feature_name="NGX_HAVE_DEFERRED_ACCEPT"
ngx_feature_run=no
ngx_feature_incs="#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>"
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="setsockopt(0, IPPROTO_TCP, TCP_DEFER_ACCEPT, NULL, 0)"
. auto/feature
ngx_feature="accept4()"
ngx_feature_name="NGX_HAVE_ACCEPT4"
ngx_feature_run=no
@ -473,7 +497,8 @@ ngx_feature_test="char buf[1]; ssize_t n; n = pwrite(1, buf, 1, 0)"
ngx_feature="sys_nerr"
ngx_feature_name="NGX_SYS_NERR"
ngx_feature_run=value
ngx_feature_incs='#include <stdio.h>'
ngx_feature_incs='#include <errno.h>
#include <stdio.h>'
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test='printf("%d", sys_nerr);'
@ -515,10 +540,10 @@ if [ $ngx_found = no ]; then
|| p == NULL
|| strncmp(p, "Unknown error", 13) == 0)
{
printf("%d", n);
return 0;
break;
}
}'
}
printf("%d", n);'
. auto/feature
fi
@ -620,6 +645,19 @@ if [ $ngx_found = no ]; then
fi
if [ $ngx_found = no ]; then
# Solaris has POSIX semaphores in librt
ngx_feature="POSIX semaphores in librt"
ngx_feature_libs=-lrt
. auto/feature
if [ $ngx_found = yes ]; then
CORE_LIBS="$CORE_LIBS -lrt"
fi
fi
ngx_feature="struct msghdr.msg_control"
ngx_feature_name="NGX_HAVE_MSGHDR_MSG_CONTROL"
ngx_feature_run=no
@ -669,3 +707,13 @@ ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="struct dirent dir; dir.d_type = DT_REG"
. auto/feature
ngx_feature="sysconf(_SC_NPROCESSORS_ONLN)"
ngx_feature_name="NGX_HAVE_SC_NPROCESSORS_ONLN"
ngx_feature_run=no
ngx_feature_incs=
ngx_feature_path=
ngx_feature_libs=
ngx_feature_test="sysconf(_SC_NPROCESSORS_ONLN)"
. auto/feature

View File

@ -21,7 +21,8 @@ types {
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg;
image/svg+xml svg svgz;
image/webp webp;
application/java-archive jar war ear;
application/mac-binhex40 hqx;
@ -62,12 +63,16 @@ types {
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;

View File

@ -6,20 +6,21 @@ TEMP= tmp
CP= $(HOME)/java
define XSLScript
javavm -cp $(CP)/xsls/saxon.jar:$(CP)/xsls/xsls.jar \
java -cp $(CP)/xsls/saxon.jar:$(CP)/xsls/xsls.jar \
com.pault.StyleSheet \
-x com.pault.XX -y com.pault.XX \
$(1) docs/xsls/dump.xsls \
| awk 'BEGIN{e=0}/^\n*$$/{e=1;next}{if(e){print"";e=0};print}' > $(2)
$(1) docs/xsls/dump.xsls \
| sed 's/ *$$//;/^ *$$/N;/\n *$$/D' > $(2)
if [ ! -s $(2) ]; then rm $(2); fi; test -s $(2)
endef
define XSLT
xsltproc $(shell echo $4 \
xmllint --noout --valid $2
xsltproc -o $3 \
$(shell echo $4 \\
| sed -e "s/\([^= ]*\)=\([^= ]*\)/--param \1 \"'\2'\"/g") \
$3 $1 \
> $(HTML)/$(strip $(2))
$1 $2
endef
@ -28,21 +29,23 @@ changes: $(TEMP)/$(NGINX)/CHANGES.ru \
$(TEMP)/$(NGINX)/CHANGES.ru: docs/xml/nginx/changes.xml \
docs/xml/change_log_conf.xml \
docs/xslt/changes.xslt
test -d $(TEMP)/$(NGINX) || mkdir -p $(TEMP)/$(NGINX)
xsltproc --param lang "'ru'" \
xsltproc --stringparam lang ru \
-o $(TEMP)/$(NGINX)/CHANGES.ru \
docs/xslt/changes.xslt docs/xml/nginx/changes.xml
$(TEMP)/$(NGINX)/CHANGES: docs/xml/nginx/changes.xml \
docs/xml/change_log_conf.xml \
docs/xslt/changes.xslt
test -d $(TEMP)/$(NGINX) || mkdir -p $(TEMP)/$(NGINX)
xsltproc --param lang "'en'" \
xsltproc --stringparam lang en \
-o $(TEMP)/$(NGINX)/CHANGES \
docs/xslt/changes.xslt docs/xml/nginx/changes.xml

View File

@ -1,5 +1,6 @@
.\"
.\" Copyright (c) 2010 Sergey A. Osokin
.\" Copyright (c) 2011,2012 Nginx, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@ -24,7 +25,7 @@
.\" SUCH DAMAGE.
.\"
.\"
.Dd November 14, 2010
.Dd August 10, 2011
.Dt NGINX 8
.Os
.Sh NAME
@ -177,25 +178,25 @@ Test configuration file
.Pa ~/mynginx.conf
with global directives for PID and quantity of worker processes.
.Sh SEE ALSO
.Xr nginx.conf 5
.\"Xr nginx.conf 5
.\"Pp
Documentation at
.Pa http://nginx.org/
and
.Pa http://sysoev.ru/nginx/ .
.Pp
For questions and technical support, please refer to
.Pa http://nginx.org/en/support.html .
.Sh HISTORY
Development of
.Nm
started in 2002, with the first public release on October 4, 2004.
.Sh AUTHORS
.An -nosplit
.An Igor Sysoev Aq igor@sysoev.ru
.Pp
Documentation available on
.Pa http://nginx.org/
and
.Pa http://sysoev.ru/nginx/ .
.Pp
This manual page was written by
.An Sergey A. Osokin Aq osa@FreeBSD.org.ru
as a result of compilation of many
.Nm
documents all over the world.
.Sh BUGS
Report to mailing list
.Aq Li nginx@nginx.org
if you found one.

View File

@ -1,5 +1,6 @@
/*
* Copyright (C) 2002-2011 Igor Sysoev
* Copyright (C) 2002-2012 Igor Sysoev
* Copyright (C) 2011,2012 Nginx, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions

View File

@ -1,4 +1,3 @@
The Russian documentation is available at http://sysoev.ru/nginx/
The English documentation is available at http://nginx.net
Documentation is available at http://nginx.org

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="KOI8-R" ?>
<?xml version="1.0" ?>
<!DOCTYPE configuration SYSTEM "../dtd/change_log_conf.dtd" >
<configuration>
@ -9,14 +9,14 @@
<indent> </indent>
<changes lang="ru">
<title>Изменения в </title>
<title>Изменения в </title>
<length>66</length>
<bugfix>Исправление</bugfix>
<feature>Добавление</feature>
<change>Изменение</change>
<security>Безопасность</security>
<workaround>Изменение</workaround>
<bugfix>Исправление</bugfix>
<feature>Добавление</feature>
<change>Изменение</change>
<security>Безопасность</security>
<workaround>Изменение</workaround>
</changes>
<changes lang="en">

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
X:stylesheet {
X:output method="text" encoding="koi8-r";
X:output method="text";
X:param lang="'en'";
X:param configuration="'../xml/change_log_conf.xml'";
@ -64,10 +64,16 @@ X:template para(prefix) = "para" {
X:template wrap(text, prefix) {
X:if "$text" {
X:var offset = {
X:if "starts-with($text, concat($br, ' '))" {
!{string-length($br) + 2}
} else {
1
X:choose {
X:when "starts-with($text, concat($br, ' '))" {
!{string-length($br) + 2}
}
X:when "starts-with($text, $br)" {
!{string-length($br) + 1}
}
X:otherwise {
1
}
}
}
@ -79,7 +85,8 @@ X:template wrap(text, prefix) {
!{$prefix}
!{translate(substring($text, $offset, $length), '&#xA0;', ' ')}
!{normalize-space(translate(substring($text, $offset, $length),
'&#xA0;', ' '))}
X:text {&#10;}
@ -89,20 +96,23 @@ X:template wrap(text, prefix) {
X:template length(text, prefix, length) {
X:var break = "substring-before(substring($text, 1, $length - $prefix),
X:var break = "substring-before(substring($text, 1,
$length - $prefix + string-length($br)),
$br)"
X:choose {
X:when "$break" { !{string-length($break)} }
X:when "$length = 0" { !{$max} }
X:when "$length = 0" { !{$max - $prefix} }
X:when "string-length($text) + $prefix &lt;= $length
or substring($text, $length - $prefix, 1) = ' '"
{
X:when "string-length($text) + $prefix &lt;= $length" {
!{$length - $prefix}
}
X:when "substring($text, $length - $prefix + 1, 1) = ' '" {
!{$length - $prefix + 1}
}
X:otherwise {
!length(text = "$text", prefix = "$prefix", length = "$length - 1")
}

View File

@ -1,26 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="koi8-r" method="text"/>
<xsl:output method="text"/>
<xsl:param select="'en'" name="lang"/>
<xsl:param select="'../xml/change_log_conf.xml'" name="configuration"/>
<xsl:variable select="document($configuration)/configuration" name="conf"/>
<xsl:variable select="$conf/start" name="start"/>
<xsl:variable select="$conf/indent" name="indent"/>
<xsl:variable select="$conf/length" name="max"/>
<xsl:variable name="br">&lt;br&gt;</xsl:variable>
<xsl:template match="/">
<xsl:apply-templates select="change_log"/>
</xsl:template>
<xsl:template match="change_log">
<xsl:apply-templates select="changes"/>
</xsl:template>
<xsl:template match="changes">
<xsl:text>
</xsl:text>
@ -31,10 +37,14 @@
</xsl:if>
<xsl:if test="$lang='en'">
<xsl:value-of select="substring(@date, 1, 2)"/>
<xsl:value-of select="$conf/changes[@lang=$lang]/month[number(substring(current()/@date, 4, 2))]"/>
<xsl:value-of select="substring(@date, 7, 4)"/>
</xsl:if>
<xsl:text>
</xsl:text>
@ -44,8 +54,8 @@
</xsl:text>
</xsl:template>
<xsl:template match="change">
<xsl:variable select="$conf/changes[@lang=$lang]/*[local-name(.)=current()/@type]" name="prefix"/>
<xsl:variable name="postfix">
@ -59,9 +69,9 @@
</xsl:apply-templates>
</xsl:template>
<xsl:template match="para" name="para">
<xsl:param name="prefix"/>
<xsl:variable name="text">
<xsl:apply-templates/>
</xsl:variable>
@ -73,6 +83,7 @@
<xsl:with-param select="normalize-space($text)" name="text"/>
<xsl:with-param name="prefix">
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:value-of select="$prefix"/>
</xsl:when>
@ -84,31 +95,38 @@
</xsl:call-template>
</xsl:template>
<xsl:template name="wrap">
<xsl:param name="text"/>
<xsl:param name="prefix"/>
<xsl:if test="$text">
<xsl:variable name="offset">
<xsl:choose>
<xsl:when test="starts-with($text, concat($br, ' '))">
<xsl:value-of select="string-length($br) + 2"/>
</xsl:when>
<xsl:when test="starts-with($text, $br)">
<xsl:value-of select="string-length($br) + 1"/>
</xsl:when>
<xsl:otherwise>
1</xsl:otherwise>
1</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="length">
<xsl:call-template name="length">
<xsl:with-param select="substring($text, $offset)" name="text"/>
<xsl:with-param select="string-length($prefix)" name="prefix"/>
<xsl:with-param select="$max" name="length"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$prefix"/>
<xsl:value-of select="translate(substring($text, $offset, $length), ' ', ' ')"/>
<xsl:value-of select="normalize-space(translate(substring($text, $offset, $length), ' ', ' '))"/>
<xsl:text>
</xsl:text>
@ -119,23 +137,29 @@
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template name="length">
<xsl:param name="text"/>
<xsl:param name="prefix"/>
<xsl:param name="length"/>
<xsl:variable select="substring-before(substring($text, 1, $length - $prefix), $br)" name="break"/>
<xsl:variable select="substring-before(substring($text, 1, $length - $prefix + string-length($br)), $br)" name="break"/>
<xsl:choose>
<xsl:when test="$break">
<xsl:value-of select="string-length($break)"/>
</xsl:when>
<xsl:when test="$length = 0">
<xsl:value-of select="$max"/>
<xsl:value-of select="$max - $prefix"/>
</xsl:when>
<xsl:when test="string-length($text) + $prefix &lt;= $length or substring($text, $length - $prefix, 1) = ' '">
<xsl:when test="string-length($text) + $prefix &lt;= $length">
<xsl:value-of select="$length - $prefix"/>
</xsl:when>
<xsl:when test="substring($text, $length - $prefix + 1, 1) = ' '">
<xsl:value-of select="$length - $prefix + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="length">
<xsl:with-param select="$text" name="text"/>
<xsl:with-param select="$prefix" name="prefix"/>
@ -145,14 +169,14 @@
</xsl:choose>
</xsl:template>
<xsl:template match="at">@</xsl:template>
<xsl:template match="br">
<xsl:value-of select="$br"/>
</xsl:template>
<xsl:template match="nobr">
<xsl:value-of select="translate(., ' ', ' ')"/>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>

View File

@ -3,11 +3,12 @@ VER = $(shell grep 'define NGINX_VERSION' src/core/nginx.h \
| sed -e 's/^.*\"\(.*\)\"/\1/')
NGINX = nginx-$(VER)
TEMP = tmp
REPO = $(shell svn info | sed -n 's/^Repository Root: //p')
OBJS = objs.msvc8
OPENSSL = openssl-0.9.8r
ZLIB = zlib-1.2.3
PCRE = pcre-7.9
OPENSSL = openssl-0.9.8u
ZLIB = zlib-1.2.5
PCRE = pcre-8.30
release:
@ -25,8 +26,6 @@ release:
rm -r $(TEMP)/$(NGINX)/src/mysql
rm $(TEMP)/$(NGINX)/src/http/modules/ngx_http_status_module.c
mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX)
mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX)
mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX)
@ -40,6 +39,22 @@ release:
tar -c -z -f $(NGINX).tar.gz --directory $(TEMP) $(NGINX)
RELEASE:
test -d $(TEMP) || mkdir -p $(TEMP)
echo "nginx-$(VER)-RELEASE" > $(TEMP)/message
svn ci -F $(TEMP)/message
echo "release-$(VER) tag" > $(TEMP)/message
svn copy $(REPO)/branches/stable-1.0 \
$(REPO)/tags/release-$(VER) \
-F $(TEMP)/message
svn up
$(MAKE) -f misc/GNUmakefile release
snapshot:
rm -rf $(TEMP)
@ -56,8 +71,6 @@ snapshot:
rm -r $(TEMP)/$(NGINX)/src/mysql
rm $(TEMP)/$(NGINX)/src/http/modules/ngx_http_status_module.c
mv $(TEMP)/$(NGINX)/docs/text/LICENSE $(TEMP)/$(NGINX)
mv $(TEMP)/$(NGINX)/docs/text/README $(TEMP)/$(NGINX)
mv $(TEMP)/$(NGINX)/docs/html $(TEMP)/$(NGINX)
@ -99,7 +112,7 @@ zip:
cp -p $(OBJS)/lib/$(PCRE)/LICENCE \
$(TEMP)/$(NGINX)/docs/PCRE.LICENCE
perl -ne 'print if /^ \(C\) 1995-2004/ .. /^ jloup\@gzip.org/' \
perl -ne 'print if /^ \(C\) 1995-20/ .. /^ jloup\@gzip.org/' \
$(OBJS)/lib/$(ZLIB)/README \
> $(TEMP)/$(NGINX)/docs/zlib.LICENSE

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
@ -203,6 +204,10 @@ main(int argc, char *const *argv)
ngx_cycle_t *cycle, init_cycle;
ngx_core_conf_t *ccf;
#if (NGX_FREEBSD)
ngx_debug_init();
#endif
if (ngx_strerror_init() != NGX_OK) {
return 1;
}
@ -212,47 +217,49 @@ main(int argc, char *const *argv)
}
if (ngx_show_version) {
ngx_log_stderr(0, "nginx version: " NGINX_VER);
ngx_write_stderr("nginx version: " NGINX_VER NGX_LINEFEED);
if (ngx_show_help) {
ngx_log_stderr(0,
ngx_write_stderr(
"Usage: nginx [-?hvVtq] [-s signal] [-c filename] "
"[-p prefix] [-g directives]" CRLF CRLF
"Options:" CRLF
" -?,-h : this help" CRLF
" -v : show version and exit" CRLF
"[-p prefix] [-g directives]" NGX_LINEFEED
NGX_LINEFEED
"Options:" NGX_LINEFEED
" -?,-h : this help" NGX_LINEFEED
" -v : show version and exit" NGX_LINEFEED
" -V : show version and configure options then exit"
CRLF
" -t : test configuration and exit" CRLF
NGX_LINEFEED
" -t : test configuration and exit" NGX_LINEFEED
" -q : suppress non-error messages "
"during configuration testing" CRLF
"during configuration testing" NGX_LINEFEED
" -s signal : send signal to a master process: "
"stop, quit, reopen, reload" CRLF
"stop, quit, reopen, reload" NGX_LINEFEED
#ifdef NGX_PREFIX
" -p prefix : set prefix path (default: "
NGX_PREFIX ")" CRLF
NGX_PREFIX ")" NGX_LINEFEED
#else
" -p prefix : set prefix path (default: NONE)" CRLF
" -p prefix : set prefix path (default: NONE)" NGX_LINEFEED
#endif
" -c filename : set configuration file (default: "
NGX_CONF_PATH ")" CRLF
NGX_CONF_PATH ")" NGX_LINEFEED
" -g directives : set global directives out of configuration "
"file" CRLF
"file" NGX_LINEFEED NGX_LINEFEED
);
}
if (ngx_show_configure) {
ngx_write_stderr(
#ifdef NGX_COMPILER
ngx_log_stderr(0, "built by " NGX_COMPILER);
"built by " NGX_COMPILER NGX_LINEFEED
#endif
#if (NGX_SSL)
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
ngx_log_stderr(0, "TLS SNI support enabled");
"TLS SNI support enabled" NGX_LINEFEED
#else
ngx_log_stderr(0, "TLS SNI support disabled");
"TLS SNI support disabled" NGX_LINEFEED
#endif
#endif
ngx_log_stderr(0, "configure arguments:" NGX_CONFIGURE);
"configure arguments:" NGX_CONFIGURE NGX_LINEFEED);
}
if (!ngx_test_config) {
@ -260,10 +267,6 @@ main(int argc, char *const *argv)
}
}
#if (NGX_FREEBSD)
ngx_debug_init();
#endif
/* TODO */ ngx_max_sockets = -1;
ngx_time_init();
@ -374,6 +377,10 @@ main(int argc, char *const *argv)
ngx_daemonized = 1;
}
if (ngx_inherited) {
ngx_daemonized = 1;
}
#endif
if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) {

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
@ -8,8 +9,8 @@
#define _NGINX_H_INCLUDED_
#define nginx_version 1000005
#define NGINX_VERSION "1.0.5"
#define nginx_version 1000015
#define NGINX_VERSION "1.0.15"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
@ -127,5 +128,7 @@ typedef intptr_t ngx_flag_t;
#define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff
#endif
#define NGX_MAX_INT32_VALUE (uint32_t) 0x7fffffff
#endif /* _NGX_CONFIG_H_INCLUDED_ */

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/
@ -580,7 +581,7 @@ ngx_configure_listening_sockets(ngx_cycle_t *cycle)
{
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
"setsockopt(SO_ACCEPTFILTER, \"%s\") "
" for %V failed, ignored",
"for %V failed, ignored",
ls[i].accept_filter, &ls[i].addr_text);
continue;
}

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

View File

@ -1,6 +1,7 @@
/*
* Copyright (C) Igor Sysoev
* Copyright (C) Nginx, Inc.
*/

Some files were not shown because too many files have changed in this diff Show More