summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_cycle.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-03-29Merge of r5138: use of NGX_FILE_ERROR.Maxim Dounin1-1/+1
Use NGX_FILE_ERROR for handling file operations errors. On Win32 platforms 0 is used to indicate errors in file operations, so comparing against either -1 or NGX_OK is not portable. This was not much of an issue in patched code, since only ngx_fd_info() test is actually reachable on Win32 and in worst case it might result in bogus error log entry. Patch by Piotr Sikora.
2013-02-11Merge of r4985, r4986, r4987, r4988, r4989, r5002: access_log gzip.Maxim Dounin1-19/+2
*) Access log: fixed redundant buffer reallocation. Previously a new buffer was allocated for every "access_log" directive with the same file path and "buffer=" parameters, while only one buffer per file is used. *) Reopening log files code moved to a separate function. The code refactored in a way to call custom handler that can do appropriate cleanup work (if any), like flushing buffers, finishing compress streams, finalizing connections to log daemon, etc.. *) Access log: the "flush" parameter of the "access_log" directive. *) Configure: added the NGX_ZLIB define. This was introduced for conditional compilation of the code that requires the zlib library. *) Access log: the "gzip" parameter of the "access_log" directive. Note: this requires zlib version 1.2.0.4 or above to work. *) The data pointer in ngx_open_file_t objects must be initialized. Uninitialized pointer may result in arbitrary segfaults if access_log is used without buffer and without variables in file path. Patch by Tatsuhiko Kubo (ticket #268).
2013-02-10Merge of r4967: ngx_write_fd() and ngx_read_fd() errors handling.Maxim Dounin1-1/+1
The ngx_write_fd() and ngx_read_fd() functions return -1 in case of error, so the incorrect comparison with NGX_FILE_ERROR (which is 0 on windows platforms) might result in inaccurate error message in the error log. Also the ngx_errno global variable is being set only if the returned value is -1.
2012-12-10Merge of r4933, r4933: shared memory fixes.Maxim Dounin1-1/+3
*) 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-11-12Merge of r4870, r4871, r4890, r4895: minor fixes.Maxim Dounin1-8/+10
*) 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-09-24Merge of r4778, r4782, r4783, r4824, r4830, r4834: minor fixes.Maxim Dounin1-8/+8
*) 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-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-11-23Added shmtx interface to forcibly unlock mutexes.Maxim Dounin1-1/+1
It is currently used from master process on abnormal worker termination to unlock accept mutex (unlocking of accept mutex was broken in 1.0.2). It is expected to be used in the future to unlock other mutexes as well. Shared mutex code was rewritten to make this possible in a safe way, i.e. with a check if lock was actually held by the exited process. We again use pid to lock mutex, and use separate atomic variable for a count of processes waiting in sem_wait().
2011-09-19Replaced "can not" with "cannot" and "could not" in a bunch of places.Ruslan Ermilov1-1/+1
Fixed nearby grammar errors.
2011-08-04A new fix for the case when ssl_session_cache defined, but ssl is notIgor Sysoev1-5/+0
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-04-04reuse keepalive connections if there are no free worker connectionsIgor Sysoev1-0/+3
patch by Maxim Dounin
2010-09-02the -q switchIgor Sysoev1-1/+2
2010-06-30fix IPv6 listen socket handling while reconfiguringIgor Sysoev1-1/+1
2010-06-04*) delete no longer used unix domain socketsIgor Sysoev1-0/+36
*) fix unix domain socket comparison
2010-03-25*) introduce ngx_time_sigsafe_update() to update the error log time onlyIgor Sysoev1-1/+1
*) change ngx_time_update() interface
2010-03-13*) use previously cached GMT offset value to update time from a signal handlerIgor Sysoev1-1/+1
*) change ngx_time_update() interface since there are no notification methods those return time
2009-10-21use lowcase only hostnameIgor Sysoev1-1/+1
2009-09-18restore environ, this fixes segfault on reconfiguration failure whenIgor Sysoev1-0/+3
perl module creates new environment
2009-09-18fix commentIgor Sysoev1-2/+2
2009-06-06win32 master process had aready closed listening socketsIgor Sysoev1-1/+2
2009-06-06a signaller process should stop configuration processing just afterIgor Sysoev1-8/+8
it is able to get pid file, this allows to not open log files, etc.
2009-06-02return NULL instead of NGX_CONF_ERROR on a create conf failureIgor Sysoev1-1/+1
2009-06-02test that zone has the same addresses in different processesIgor Sysoev1-5/+15
2009-05-05use correct nameIgor Sysoev1-1/+1
2009-04-30*) refactor error_log processing: listen socket log might inherit built-inIgor Sysoev1-14/+10
error_log with zero level, and r2447, r2466, r2467 were not enough *) remove bogus "stderr" level *) some functions and fields renames
2009-04-29uniform ngx_file_info() interface with ngx_fd_info()Igor Sysoev1-1/+3
2009-04-27-p and --prefix=Igor Sysoev1-15/+17
2009-04-23issue start up errors and warning on both stderr and error_logIgor Sysoev1-18/+7
2009-04-21implement "-s signal" option for UnixIgor Sysoev1-5/+59
2009-04-21style fix: remove tabsIgor Sysoev1-5/+5
2009-04-20Win32 master/workers modelIgor Sysoev1-8/+4
2009-04-19show -t results on stderrIgor Sysoev1-3/+2
2009-04-18support attaching to an existent Win32 shared memoryIgor Sysoev1-33/+44
2009-04-17fix the previous commitIgor Sysoev1-2/+3
2009-04-16move zone name from ngx_shm_zone_t to ngx_shm_t to use Win32 shared memoryIgor Sysoev1-17/+20
2009-04-08style fixIgor Sysoev1-4/+4
2009-04-08delete win32 ngx_file_append_mode() as we use reliableIgor Sysoev1-23/+2
FILE_APPEND_DATA|SYNCHRONIZE flags
2009-04-08adopt NGX_FILE_TRUNCATE for win32Igor Sysoev1-4/+3
2009-03-31Win32 appends synchronized if only FILE_APPEND_DATA and SYNCHRONIZE are setIgor Sysoev1-2/+2
without any other flags. On the other hand, Unix requires at least the write flag to be set together with O_APPEND.
2009-03-30win32 ngx_open_file() supports utf8 names and NGX_FILE_APPENDIgor Sysoev1-5/+5
2009-02-24small optimization: " == NGX_ERROR" > " != NGX_OK"Igor Sysoev1-2/+2
2009-02-21a prelimiary IPv6 support, HTTP listenIgor Sysoev1-11/+35
2009-01-26revert the previous commit and r2447 change in src/core/ngx_cycle.cIgor Sysoev1-1/+4
2009-01-26default error_log has zero level, the bug has been introduced in r2447Igor Sysoev1-0/+1
2009-01-16set the error level as default http error_log levelIgor Sysoev1-4/+0
2008-11-11compatibility with glibc 2.3, warn_unused_result attribute for write()Igor Sysoev1-3/+18
2008-08-30ngx_timezone_update()Igor Sysoev1-0/+11
2008-06-30-g switchIgor Sysoev1-0/+15
2008-06-17*) back out r2040Igor Sysoev1-4/+4
*) refactor ngx_palloc() *) introduce ngx_pnalloc() *) additional pool blocks have smaller header
2008-05-16$hostname variableIgor Sysoev1-0/+21