summaryrefslogtreecommitdiffhomepage
path: root/src/core (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2012-12-10Merge of r4933, r4933: shared memory fixes.Maxim Dounin2-4/+6
*) Fixed location of debug message in ngx_shmtx_lock(). *) Core: don't reuse shared memory zone that changed ownership (ticket #210). nginx doesn't allow the same shared memory zone to be used for different purposes, but failed to check this on reconfiguration. If a shared memory zone was used for another purpose in the new configuration, nginx attempted to reuse it and crashed.
2012-12-10Merge of r4918: cache manager startup with many listen sockets.Maxim Dounin1-0/+2
Fixed failure to start cache manager and cache loader processes if there were more than 512 listening sockets in configuration.
2012-12-10Version bump.Maxim Dounin1-2/+2
2012-11-13Merge of r4891: worker_processes auto.Maxim Dounin1-2/+33
Core: the "auto" parameter of the "worker_processes" directive. The parameter will set the number of worker processes to the autodetected number of available CPU cores.
2012-11-12Merge of r4872, r4893: resolver cached addresses random rotation.Maxim Dounin1-2/+29
Resolver: cached addresses are returned with random rotation now. This ensures balancing when working with dynamically resolved upstream servers with multiple addresses. Based on patch by Anton Jouline.
2012-11-12Merge of r4870, r4871, r4890, r4895: minor fixes.Maxim Dounin4-16/+18
*) Made sure to initialize the entire ngx_file_t structure. Found by Coverity. *) Correct plural form for "path" in the whole source base. *) Removed conditional compilation from waitpid() error test. There are reports that call to a signal handler for an exited process despite waitpid() already called for the process may happen on Linux as well. *) Style, parentheses instead of braces in misc/GNUMakefile.
2012-11-12Version bump.Maxim Dounin1-2/+2
2012-09-24Merge of r4828: "include" with wildcards in map and types blocks.Maxim Dounin2-2/+2
The "include" directive should be able to include multiple files if given a filename mask. Fixed this to work for "include" directives inside the "map" or "types" blocks. The "include" directive inside the "geo" block is still not fixed.
2012-09-24Merge of r4785, r4795, r4811, r4812, r4816, r4822: coverity.Maxim Dounin2-11/+18
*) Resolver: fixed possible memory leak in ngx_resolver_create(). *) Explicitly ignore returned value from unlink() in ngx_open_tempfile(). *) Explicitly ignore returned value from close() in ngx_event_core_init_conf(). *) Added three missing checks for NULL after ngx_array_push() calls. *) Crypt: fixed handling of corrupted SSHA entries in password file. *) Mark logically dead code with corresponding comment. Found by / prodded by Coverity.
2012-09-24Merge of r4784: fixed the -p parameter handling.Maxim Dounin1-1/+1
Ensure that the path supplied always ends with a `/' except when empty. An empty value now corresponds to the current directory instead of `/'.
2012-09-24Merge of r4778, r4782, r4783, r4824, r4830, r4834: minor fixes.Maxim Dounin6-13/+17
*) Reorder checks in ngx_shared_memory_add() for more consistent error messages. *) 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. *) 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. *) Radix tree preallocation fix. The preallocation size was calculated incorrectly and was always 8 due to sizeof(ngx_radix_tree_t) accidentally used instead of sizeof(ngx_radix_node_t). *) Fixed overflow if ngx_slab_alloc() is called with very big "size" argument. *) Write filter: replaced unneeded loop with one to free chains. Noted by Gabor Lekeny.
2012-09-24Version bump.Maxim Dounin1-2/+2
2012-08-06Merge of r4739: s/ngx_shmtx_destory/ngx_shmtx_destroy/.Maxim Dounin2-4/+4
2012-08-06Merge of r4769: better diagnostics for directives in wrong context.Maxim Dounin2-22/+15
2012-08-06Merge of r4765: reduced the number of preprocessor directives.Maxim Dounin1-5/+1
2012-08-06Merge of r4760, r4761: -Wmissing-prototypes.Maxim Dounin2-0/+5
Fixed compilation with -Wmissing-prototypes. Added a commented out -Wmissing-prototypes to CFLAGS. It is commented out to not break builds with 3rd party modules.
2012-08-06Version bump.Maxim Dounin1-2/+2
2012-07-02Merge of r4690: conflicting wildcard server names fix.Maxim Dounin1-11/+13
With previous code wildcard names were added to hash even if conflict was detected. This resulted in identical names in hash and segfault later in ngx_hash_wildcard_init().
2012-07-02Merge of r4654, r4672, r4684, r4685, r4692: resolver changes.Maxim Dounin1-16/+17
*) Resolver: fixed format specification. Patch by Yichun Zhang (agentzh). *) Support for IPv6 literals and an optional port in resolver. *) Fixed crash in ngx_resolver_cleanup_tree(). If sending a DNS request fails with an error (e.g., when mistakenly trying to send it to a local IP broadcast), such a request is not deleted if there are clients waiting on it. However, it was still erroneously removed from the queue. Later ngx_resolver_cleanup_tree() attempted to remove it from the queue again that resulted in a NULL pointer dereference. *) When "resolver" is configured with a domain name, only the first resolved address was used. Now all addresses will be used. *) Fixed segfault with poll and resolver used. Poll event method needs ngx_cycle->files to work, and use of ngx_exit_cycle without files set caused null pointer dereference in resolver's cleanup on udp socket close.
2012-07-02Merge of r4671: support for IPv6 literals in proxy_pass and so on.Maxim Dounin1-7/+30
2012-07-02Merge of r4653: ngx_inet.c code reduction.Maxim Dounin1-19/+2
Code reduction (no functional changes).
2012-07-02Merge of r4644:Maxim Dounin1-1/+6
Fixed potential null pointer dereference in ngx_resolver_create(). While here, improved error message.
2012-07-02Merge of r4643:Maxim Dounin1-5/+0
Removed historical and now redundant syntax pre-checks in ngx_parse_url().
2012-06-29Merge of r4639, r4640: C++ fixes.Maxim Dounin2-5/+5
Fixed the ngx_regex.h header file compatibility with C++. Fixed building --with-cpp_test_module on some systems.
2012-06-25Version bump.Maxim Dounin1-2/+2
2012-06-04Merge of r4611, r4620: resolver fixes.Maxim Dounin1-2/+14
*) Fixed segmentation fault in ngx_resolver_create_name_query(). If name passed for resolution was { 0, NULL } (e.g. as a result of name server returning CNAME pointing to ".") pointer wrapped to (void *) -1 resulting in segmentation fault on an attempt to dereference it. Reported by Lanshun Zhou. *) Resolver: protection from duplicate responses. If we already had CNAME in resolver node (i.e. rn->cnlen and rn->u.cname set), and got additional response with A record, it resulted in rn->cnlen set and rn->u.cname overwritten by rn->u.addr (or rn->u.addrs), causing segmentation fault later in ngx_resolver_free_node() on an attempt to free overwritten rn->u.cname. The opposite (i.e. CNAME got after A) might cause similar problems as well.
2012-06-04Version bump.Maxim Dounin1-2/+2
2012-04-23Version bump.Maxim Dounin1-2/+2
2012-04-23Fix of "%f" format handling.Igor Sysoev1-16/+19
ngx_sprintf("%.2f", 0.999) incorrectly resulted in "0.100" instead of "1.00".
2012-04-18Don't silently ignore the last line of configuration file thatRuslan Ermilov1-1/+1
consists solely of one unterminated token (inspired by #150).
2012-04-12Fixed grammar in error messages.Ruslan Ermilov2-2/+3
2012-04-12Version bump.Maxim Dounin1-2/+2
2012-04-12Reduced the number of lines of code in ngx_inet_addr().Ruslan Ermilov1-5/+1
2012-04-11Improved readability of the code that produces bitmask from prefix.Ruslan Ermilov1-2/+2
In collaboration with Maxim Dounin.
2012-04-06Fixed signed integer overflows in timer code (ticket #145).Maxim Dounin1-2/+1
Integer overflow is undefined behaviour in C and this indeed caused problems on Solaris/SPARC (at least in some cases). Fix is to subtract unsigned integers instead, and then cast result to a signed one, which is implementation-defined behaviour and used to work. Strictly speaking, we should compare (unsigned) result with the maximum value of the corresponding signed integer type instead, this will be defined behaviour. This will require much more changes though, and considered to be overkill for now.
2012-04-05Comment fixed.Andrey Belov1-1/+1
2012-04-03In ngx_ptocidr(), check that the supplied prefix length is withinRuslan Ermilov1-0/+7
the allowed range.
2012-04-03Fixed spelling in multiline C comments.Ruslan Ermilov5-6/+6
2012-04-02Version bump.Maxim Dounin1-2/+2
2012-03-22Resolver: added missing sanity checking when creating name queries.Maxim Dounin1-1/+5
Found by Veracode.
2012-03-21worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.Ruslan Ermilov2-11/+11
2012-03-15Version bump.Maxim Dounin1-2/+2
2012-03-05Whitespace fixes.Maxim Dounin1-1/+1
2012-03-05Version bump.Maxim Dounin1-2/+2
2012-02-28Fixed spelling in single-line comments.Ruslan Ermilov1-1/+1
2012-02-27Fix of rbtree lookup on hash collisions.Maxim Dounin2-22/+12
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-02-27Fixed null pointer dereference in resolver (ticket #91).Maxim Dounin1-5/+6
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-02-27Disable symlinks: added the "from" parameter support to the open file cache.Valentin Bartenev2-1/+26
2012-02-21Disable symlinks: use O_SEARCH|O_DIRECTORY to open path components.Valentin Bartenev1-30/+14
2012-02-21Disable symlinks: don't allow creating or truncating a file via a symlink inValentin Bartenev1-1/+3
the last path component if "if_not_owner" parameter is used. To prevent race condition we have to open a file before checking its owner and there's no way to change access flags for already opened file descriptor, so we disable symlinks for the last path component at all if flags allow creating or truncating the file.