summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_cycle.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-03-07Core: fixed wrong indices in listening sockets compare loops.Maxim Dounin1-3/+3
Proper use is "ls[i]" and "nls[n]". Previous code used it wrong in several places, likely due to cut-n-paste errors.
2013-12-06Core: externalized ngx_cmp_sockaddr().Ruslan Ermilov1-70/+3
It's also extended with the "cmp_port" argument to indicate whether ports should be compared as well, or only addresses.
2013-10-24Core: apply missed options to sockets added during binary upgrade.Piotr Sikora1-0/+10
The accept_filter and deferred options were not applied to sockets that were added to configuration during binary upgrade cycle. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2013-09-04Win32: MinGW GCC compatibility.Maxim Dounin1-3/+3
Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
2013-06-28Core: consolidated log-related code.Vladimir Homutov1-23/+5
The stderr redirection code is moved to ngx_log_redirect_stderr(). The opening of the default log code is moved to ngx_log_open_default().
2013-06-13Core: moved initialization of log level.Vladimir Homutov1-1/+2
The cycle->new_log->log_level should only be initialized by ngx_init_cycle() if no error logs were found in the configuration. This move allows to get rid of extra initialization in ngx_error_log().
2013-06-04Core: fixed handling of "stderr" in error_log.Vladimir Homutov1-3/+4
If "stderr" was specified in one of the "error_log" directives, stderr is not redirected to the first error_log on startup, configuration reload, and reopening log files.
2013-06-03Core: fixed stderr redirection on win32 in ngx_reopen_files().Vladimir Homutov1-7/+4
On win32 stderr was not redirected into a file specified by "error_log" while reopening files. Fix is to use platform-independent functions to work with stderr, as already used by ngx_init_cycle() and main() since rev. d8316f307b6a.
2013-03-25Use NGX_FILE_ERROR for handling file operations errors.Valentin Bartenev1-1/+1
On Win32 platforms 0 is used to indicate errors in file operations, so comparing against -1 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.
2012-12-23Reopening log files code moved to a separate function.Valentin Bartenev1-19/+2
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..
2012-12-14Fixed handling of ngx_write_fd() and ngx_read_fd() errors.Valentin Bartenev1-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-11-23Core: don't reuse shared memory zone that changed ownership (ticket #210).Ruslan Ermilov1-1/+3
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-09-28Correct plural form for "path" in the whole source base.Andrey Belov1-8/+8
2012-09-28Made sure to initialize the entire ngx_file_t structure.Andrey Belov1-0/+2
Found by Coverity.
2012-08-01Reorder checks in ngx_shared_memory_add() for more consistent error messages.Andrey Belov1-8/+8
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