summaryrefslogtreecommitdiffhomepage
path: root/src/core/nginx.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-07-19Core: fixed environment variables on exit.Maxim Dounin1-2/+51
Similarly to 6822:c045b4926b2c, environment variables introduced with the "env" directive (and "NGINX_BPF_MAPS" added by QUIC) are now allocated via ngx_alloc(), and explicitly freed by a cleanup handler if no longer used. In collaboration with Sergey Kandaurov.
2020-12-25QUIC: ngx_quic_bpf module.Vladimir Homutov1-0/+3
The quic kernel bpf helper inspects packet payload for DCID, extracts key and routes the packet into socket matching the key. Due to reuseport feature, each worker owns a personal socket, which is identified by the same key, used to create DCID. BPF objects are locked in RAM and are subject to RLIMIT_MEMLOCK. The "ulimit -l" command may be used to setup proper limits, if maps cannot be created with EPERM or updated with ETOOLONG.
2020-11-19Core: "-e" command line option.Igor Ippolitov1-4/+37
When installing or running from a non-root user it is sometimes required to override default, compiled in error log path. There was no way to do this without rebuilding the binary (ticket #147). This patch introduced "-e" command line option which allows one to override compiled in error log path.
2020-06-01Fixed removing of listening UNIX sockets when "changing binary".Ruslan Ermilov1-0/+1
When changing binary, sending a SIGTERM to the new binary's master process should not remove inherited UNIX sockets unless the old binary's master process has exited.
2018-03-22Improved code readability (closes #1512).Ruslan Ermilov1-2/+2
2017-11-28Fixed "changing binary" when reaper is not init.Ruslan Ermilov1-0/+1
On some systems, it's possible that reaper of orphaned processes is set to something other than "init" process. On such systems, the changing binary procedure did not work. The fix is to check if PPID has changed, instead of assuming it's always 1 for orphaned processes.
2017-08-08Slab: fixed initialization on win32.Ruslan Ermilov1-0/+6
On Windows, a worker process does not call ngx_slab_init() from ngx_init_zone_pool(), so ngx_slab_max_size, ngx_slab_exact_size, and ngx_slab_exact_shift were left uninitialized.
2017-03-07Introduced worker_shutdown_timeout.Maxim Dounin1-0/+9
The directive configures a timeout to be used when gracefully shutting down worker processes. When the timer expires, nginx will try to close all the connections currently open to facilitate shutdown.
2016-12-07Core: fixed environment on exit.Maxim Dounin1-8/+40
On exit environment allocated from a pool is no longer available, leading to a segmentation fault if, for example, a library tries to use it from an atexit() handler. Fix is to allocate environment via ngx_alloc() instead, and explicitly free it using a pool cleanup handler if it's no longer used (e.g., on configuration reload).
2016-03-31SSL: SSLeay_version() is deprecated in OpenSSL 1.1.0.Maxim Dounin1-3/+2
SSLeay_version() and SSLeay() are no longer available if OPENSSL_API_COMPAT is set to 0x10100000L. Switched to using OpenSSL_version() instead. Additionally, we now compare version strings instead of version numbers, and this correctly works for LibreSSL as well.
2016-03-31Fixed logging.Sergey Kandaurov1-1/+1
2016-03-18Fix build with -Wmissing-prototypes.Piotr Sikora1-2/+2
Broken in 5eb4d7541107 (1.9.6), fix somehow missed in 3600bbfb43e3. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-02-18Core: added support for more than 64 CPUs in worker_cpu_affinity.Vladimir Homutov1-25/+48
2016-02-15Core: improved logging on invalid NGINX variable (ticket #900).Maxim Dounin1-0/+6
2016-02-04Dynamic modules.Maxim Dounin1-0/+109
The auto/module script is extended to understand ngx_module_link=DYNAMIC. When set, it links the module as a shared object rather than statically into nginx binary. The module can later be loaded using the "load_module" directive. New auto/module parameter ngx_module_order allows to define module loading order in complex cases. By default the order is set based on ngx_module_type. 3rd party modules can be compiled dynamically using the --add-dynamic-module configure option, which will preset ngx_module_link to "DYNAMIC" before calling the module config script. Win32 support is rudimentary, and only works when using MinGW gcc (which is able to handle exports/imports automatically). In collaboration with Ruslan Ermilov.
2016-02-04Dynamic modules: moved module-related stuff to separate files.Maxim Dounin1-5/+2
2016-01-11Core: worker_cpu_affinity auto.Maxim Dounin1-2/+41
If enabled, workers are bound to available CPUs, each worker to once CPU in order. If there are more workers than available CPUs, remaining are bound in a loop, starting again from the first available CPU. The optional mask parameter defines which CPUs are available for automatic binding. In collaboration with Vladimir Homutov.
2015-10-19Style: unneeded casts of cf->args->elts removed.Maxim Dounin1-2/+2
2015-07-12Extract out version info function.Kurtis Nusbaum1-58/+65
The code for displaying version info and configuration info seemed to be cluttering up the main function. I was finding it hard to read main. This extracts out all of the logic for displaying version and configuration info into its own function, thus making main easier to read.
2015-05-14Core: store and dump processed configuration.Vladimir Homutov1-2/+28
If the -T option is passed, additionally to configuration test, configuration files are output to stdout. In the debug mode, configuration files are kept in memory and can be accessed using a debugger.
2015-04-23Removed the "worker_rlimit_sigpending" directive.Ruslan Ermilov1-8/+0
It was only needed by the just removed rtsig module.
2015-03-26Removed "worker_threads" and "thread_stack_size" directives.Ruslan Ermilov1-31/+0
2015-04-16Fixed build, broken by 8b7f062a3fe6.Ruslan Ermilov1-1/+2
Casting a "const char *" to "char *" doesn't work on older gcc versions.
2015-04-16Core: added OpenSSL version information to "nginx -V" output.Vladimir Homutov1-5/+16
2015-03-04Renamed NGX_THREADS to NGX_OLD_THREADS because of deprecation.Ruslan Ermilov1-3/+3
It's mostly dead code and the original idea of worker threads has been rejected.
2014-05-20Configure: the --build= option.Ruslan Ermilov1-1/+1
If set, its value is output in "nginx -v" and in the error log.
2013-08-20Backed out f1a91825730a and 7094bd12c1ff.Maxim Dounin1-7/+3
While ngx_get_full_name() might have a bit more descriptive arguments, the ngx_conf_full_name() is generally easier to use when parsing configuration and limits exposure of cycle->prefix / cycle->conf_prefix details.
2013-08-06Replaced ngx_conf_full_name() with ngx_get_full_name().Valentin Bartenev1-3/+7
The ngx_get_full_name() function takes more readable arguments list.
2013-06-28Core: consolidated log-related code.Vladimir Homutov1-7/+2
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-04Core: fixed handling of "stderr" in error_log.Vladimir Homutov1-1/+1
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-03-25Use NGX_FILE_ERROR for handling file operations errors.Valentin Bartenev1-2/+4
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.
2013-03-20Core: fixed resource leak if binary upgrade fails due to no memory.Ruslan Ermilov1-0/+1
Found by Coverity (CID 992320).
2013-03-18Core: guard against failed allocation during binary upgrade.Ruslan Ermilov1-0/+3
Patch by Piotr Sikora.
2012-10-23Core: the "auto" parameter of the "worker_processes" directive.Andrey Belov1-2/+33
The parameter will set the number of worker processes to the autodetected number of available CPU cores.
2012-08-03Fixed the -p parameter handling.Ruslan Ermilov1-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-04-12Fixed grammar in error messages.Ruslan Ermilov1-1/+1
2012-03-21worker_cpu_affinity: cleaned up Linux implementation, added FreeBSD support.Ruslan Ermilov1-9/+9
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-11-15Fixed handling of SIGWINCH/NOACCEPT signal.Maxim Dounin1-0/+4
After first upgrade it was ignored since r4020 (1.1.1, 1.0.9) as ngx_daemonized wasn't set.
2011-11-14Introduction of simple ngx_write_stderr() instead of ngx_log_stderr()Igor Sysoev1-18/+20
for output of ./configure options, etc., since ngx_log_stderr() output length is limited by 2048 characters defined as NGX_MAX_ERROR_STR.
2011-10-24malloc() debugging on MacOSX.Igor Sysoev1-2/+0
2011-10-24FreeBSD's MALLOC_OPTIONS must be set before any malloc() call.Igor Sysoev1-4/+4
The bug has been introduced in r3799.
2010-11-29move ngx_strerror_init() at the very startIgor Sysoev1-4/+4
2010-11-25use copied strerror() messages and autoconfigured sys_nerr valueIgor Sysoev1-0/+4
2010-09-15worker_rlimit_core should be off_tIgor Sysoev1-2/+2
2010-09-02the -q switchIgor Sysoev1-3/+12
2010-05-14ngx_str_set() and ngx_str_null()Igor Sysoev1-12/+6
2010-03-26fix commentsIgor Sysoev1-1/+1
2009-12-17fix r3331:Igor Sysoev1-3/+0
*) now pools are aligned to 16 bytes *) forbidden to set non-aligned pool sizes
2009-10-26fix r3211Igor Sysoev1-0/+4