aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
Commit message (Collapse)AuthorAge
...
* FreeBSD has migrated to Bugzilla.Sergey Kandaurov2014-06-19
|
* Configure: added -Wno-deprecated-declarations on OS X.Maxim Dounin2014-05-28
| | | | | | | Previous workaround to avoid warnings on OS X due to deprecated system OpenSSL library (introduced in a3870ea96ccd) no longer works, as the MAC_OS_X_VERSION_MIN_REQUIRED macro is ignored on OS X 10.9 if a compiler used supports __attribute__(availability).
* Events: use eventfd() instead of syscall(SYS_eventfd) if possible.Ruslan Ermilov2014-05-23
| | | | | | | | | This fixes --with-file-aio support on systems that lack eventfd() syscall, notably aarch64 Linux. The syscall(SYS_eventfd) may still be necessary on systems that have eventfd() syscall in the kernel but lack it in glibc, e.g. as seen in the current CentOS 5 release.
* Added syslog support for error_log and access_log directives.Vladimir Homutov2014-05-12
|
* Configure: the --build= option.Ruslan Ermilov2014-05-20
| | | | If set, its value is output in "nginx -v" and in the error log.
* Added #ifndef around NGX_HAVE_CASELESS_FILESYSTEM define.Maxim Dounin2014-03-31
| | | | | | This brings Cygwin compilation in line with other case-insensitive systems (notably win32 and OS X) where one can force case sensitivity using -DNGX_HAVE_CASELESS_FILESYSTEM=0.
* Added connection serial number in logging of left open sockets.Sergey Kandaurov2014-03-06
|
* Use ngx_socket_errno where appropriate.Piotr Sikora2014-02-03
| | | | Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
* Core: handle getsockopt(TCP_FASTOPEN) failures.Piotr Sikora2014-01-30
| | | | | | | | | | Linux returns EOPNOTSUPP for non-TCP sockets and ENOPROTOOPT for TCP sockets, because getsockopt(TCP_FASTOPEN) is not implemented so far. While there, lower the log level from ALERT to NOTICE to match other getsockopt() failures. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
* Added per-process random seeding (ticket #456).Maxim Dounin2014-01-04
|
* Core: handling of getsockopt(TCP_DEFER_ACCEPT) failures.Maxim Dounin2013-10-31
| | | | | | Recent Linux versions started to return EOPNOTSUPP to getsockopt() calls on unix sockets, resulting in log pollution on binary upgrade. Such errors are silently ignored now.
* Added ngx_filename_cmp() with "/" sorted to the left.Maxim Dounin2013-09-23
| | | | | | | | | | | | | | | | | | | | | | This patch fixes incorrect handling of auto redirect in configurations like: location /0 { } location /a- { } location /a/ { proxy_pass ... } With previously used sorting, this resulted in the following locations tree (as "-" is less than "/"): "/a-" "/0" "/a/" and a request to "/a" didn't match "/a/" with auto_redirect, as it didn't traverse relevant tree node during lookup (it tested "/a-", then "/0", and then falled back to null location). To preserve locale use for non-ASCII characters on case-insensetive systems, libc's tolower() used.
* Fixed handling of the ready flag with kqueue.Valentin Bartenev2013-09-05
| | | | | There is nothing to do more when recv() has returned 0, so we should drop the flag.
* Disable symlinks: use O_PATH to open path components.Valentin Bartenev2013-09-02
| | | | | | | | | | | | | | | | | It was introduced in Linux 2.6.39, glibc 2.14 and allows to obtain file descriptors without actually opening files. Thus made it possible to traverse path with openat() syscalls without the need to have read permissions for path components. It is effectively emulates O_SEARCH which is missing on Linux. O_PATH is used in combination with O_RDONLY. The last one is ignored if O_PATH is used, but it allows nginx to not fail when it was built on modern system (i.e. glibc 2.14+) and run with a kernel older than 2.6.39. Then O_PATH is unknown to the kernel and ignored, while O_RDONLY is used. Sadly, fstat() is not working with O_PATH descriptors till Linux 3.6. As a workaround we fallback to fstatat() with the AT_EMPTY_PATH flag that was introduced at the same time as O_PATH.
* Added the NGX_EBADF define.Valentin Bartenev2013-09-02
|
* Autoindex: improved ngx_de_info() error handling.Sergey Kandaurov2013-07-30
| | | | | This allows to build a directory listing whenever a loop exists in symbolic link resolution of the path argument.
* Format specifier fixes in error logging.Sergey Kandaurov2013-08-20
|
* Unbreak building on Linux without sendfile64() support.Valentin Bartenev2013-08-15
| | | | | | | | | | | | It was broken in 8e446a2daf48 when the NGX_SENDFILE_LIMIT constant was added to ngx_linux_sendfile_chain.c having the same name as already defined one in ngx_linux_config.h. The newer is needed to overcome a bug in old Linux kernels by limiting the number of bytes to send per sendfile() syscall. The older is used with sendfile() on ancient kernels that works with 32-bit offsets only. One of these renamed to NGX_SENDFILE_MAXSIZE.
* Don't lose pointer to first nonempty buf in ngx_*_sendfile_chain().Gleb Smirnoff2013-08-08
| | | | | | | | In ngx_*_sendfile_chain() when calculating pointer to a first non-zero sized buf, use "in" as iterator. This fixes processing of zero sized buf(s) after EINTR. Otherwise function can return zero sized buf to caller, and later ngx_http_write_filter() logs warning.
* On DragonFlyBSD, TCP_KEEPIDLE and TCP_KEEPINTVL are in msecs.Ruslan Ermilov2013-07-25
| | | | Based on a patch by Sepherosa Ziehau.
* Events: honor NGX_USE_GREEDY_EVENT when kqueue support is enabled.Valentin Bartenev2013-07-13
| | | | | | Currently this flag is needed for epoll and rtsig, and though these methods usually present on different platforms than kqueue, nginx can be compiled to support all of them.
* Style.Maxim Dounin2013-07-11
|
* Make macros safe.Gleb Smirnoff2013-07-05
|
* Fixed build on Linux with x32 ABI.Maxim Dounin2013-06-26
| | | | | | | | | On Linux x32 inclusion of sys/sysctl.h produces an error. As sysctl() is only used by rtsig event method code, which is legacy and not compiled in by default on modern linuxes, the sys/sysctl.h file now only included if rtsig support is enabled. Based on patch by Serguei I. Ivantsov.
* Core: support several "error_log" directives.Vladimir Homutov2013-06-20
| | | | | | | | | | | | When several "error_log" directives are specified in the same configuration block, logs are written to all files with a matching log level. All logs are stored in the singly-linked list that is sorted by log level in the descending order. Specific debug levels (NGX_LOG_DEBUG_HTTP,EVENT, etc.) are not supported if several "error_log" directives are specified. In this case all logs will use debug level that has largest absolute value.
* Valgrind: another complaint about uninitialized bytes.Tatsuhiko Kubo2013-06-12
|
* Valgrind: supressed complaints about uninitialized bytes.Maxim Dounin2013-06-05
| | | | | | | | | | | | | | | | Valgrind complains if we pass uninitialized memory to a syscall: ==36492== Syscall param sendmsg(msg.msg_iov[0]) points to uninitialised byte(s) ==36492== at 0x6B5E6A: sendmsg (in /usr/lib/system/libsystem_kernel.dylib) ==36492== by 0x10004288E: ngx_signal_worker_processes (ngx_process_cycle.c:527) ==36492== by 0x1000417A7: ngx_master_process_cycle (ngx_process_cycle.c:203) ==36492== by 0x100001F10: main (nginx.c:410) ==36492== Address 0x7fff5fbff71c is on thread 1's stack Even initialization of all members of the structure passed isn't enough, as there is padding which still remains uninitialized and results in Valgrind complaint. Note there is no real problem here as data from uninitialized memory isn't used.
* Valgrind: sigaction() failure now ignored.Maxim Dounin2013-06-05
| | | | | | Valgrind intercepts SIGUSR2 in some cases, and nginx might not be able to start due to sigaction() failure. If compiled with NGX_VALGRIND defined, we now ignore the failure of sigaction().
* Use "void" for functions with empty parameter list.Sergey Kandaurov2013-05-23
|
* Style: remove unnecessary references to HTTP from non-HTTP modules.Piotr Sikora2013-05-21
| | | | | | No functional changes. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
* Use NGX_FILE_ERROR for handling file operations errors.Valentin Bartenev2013-03-25
| | | | | | | | | | | 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.
* Core: crypt_r() error handling fixed.Maxim Dounin2012-12-21
| | | | | | | | | | | | The crypt_r() function returns NULL on errors, check it explicitly instead of assuming errno will remain 0 if there are no errors (per POSIX, the setting of errno after a successful call to a function is unspecified unless the description of that function specifies that errno shall not be modified). Additionally, dropped unneeded ngx_set_errno(0) and fixed error handling of memory allocation after normal crypt(), which was inapropriate and resulted in null pointer dereference on allocation failures.
* Core: removed GLOB_NOSORT glob option.Maxim Dounin2012-11-29
| | | | | | | | | | | This will result in alphabetical sorting of included files if the "include" directive with wildcards is used. Note that the behaviour is now different from that on Windows, where alphabetical sorting is not guaranteed for FindFirsFile()/FindNextFile() (used to be alphabetical on NTFS, but not on FAT). Approved by Igor Sysoev, prodded by many.
* Core: fixed ngx_write_chain_to_file() with IOV_MAX reached.Maxim Dounin2012-11-26
| | | | | | | Catched by dav_chunked.t on Solaris. In released versions this might potentially result in corruption of complex protocol responses if they were written to disk and there were more distinct buffers than IOV_MAX in a single write.
* Core: added debug logging of writev() in ngx_write_chain_to_file().Maxim Dounin2012-11-21
|
* Fixed failure to start cache manager and cache loader processesIgor Sysoev2012-11-20
| | | | if there were more than 512 listening sockets in configuration.
* Fixed setting of CPU affinity on respawn of dead worker processes.Ruslan Ermilov2012-11-16
| | | | | Worker processes are now made aware of their sequential number needed to select CPU affinity mask. This replaces a workaround from r4865.
* Removed conditional compilation from waitpid() error test.Maxim Dounin2012-10-18
| | | | | | 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.
* Correct plural form for "path" in the whole source base.Andrey Belov2012-09-28
|
* Added clearing of cpu_affinity after process spawn.Maxim Dounin2012-09-26
| | | | | | | | | This fixes unwanted/incorrect cpu_affinity use on dead worker processes respawn. While this is not ideal, it's expected to be better when previous situation where multiple processes were spawn with identical CPU affinity set. Reported by Charles Chen.
* Explicitly ignore returned value from unlink() in ngx_open_tempfile().Andrey Belov2012-08-06
| | | | | | | | The only thing we could potentially do here in case of error returned is to complain to error log, but we don't have log structure available here due to interface limitations. Prodded by Coverity.
* Fixed compilation with -Wmissing-prototypes.Ruslan Ermilov2012-07-24
|
* Made sure to initialize the entire "struct flock" allocated on stack.Ruslan Ermilov2012-07-03
|
* Fixed return type of ngx_strerror_init().Maxim Dounin2012-06-18
|
* Fixed "sendmsg() failed" alerts on HP-UX.Maxim Dounin2012-06-18
| | | | | | | | HP-UX needs _HPUX_ALT_XOPEN_SOCKET_API to be defined to be able to use various POSIX versions of networking functions. Notably sendmsg() resulted in "sendmsg() failed (9: Bad file number)" alerts without it. See xopen_networking(7) for more details.
* Fixed segfault with poll and resolver used.Maxim Dounin2012-06-18
| | | | | | 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.
* Fixed compilation with -DNGX_DEBUG_MALLOC on FreeBSD 10.Maxim Dounin2012-05-23
| | | | | After jemalloc 3.0.0 import there is no _malloc_options symbol, it has been replaced with the malloc_conf one with a different syntax.
* Accept moderation in case of EMFILE/ENFILE.Maxim Dounin2012-05-11
| | | | | | | | | | | | | | | In case of EMFILE/ENFILE returned from accept() we disable accept events, and (in case of no accept mutex used) arm timer to re-enable them later. With accept mutex we just drop it, and rely on normal accept mutex handling to re-enable accept events once it's acquired again. As we now handle errors in question, logging level was changed to "crit" (instead of "alert" used for unknown errors). Note: the code might call ngx_enable_accept_events() multiple times if there are many listen sockets. The ngx_enable_accept_events() function was modified to check if connection is already active (via c->read->active) and skip it then, thus making multiple calls safe.
* Fixed ngx_readv_chain() to honor IOV_MAX (ticket #14).Maxim Dounin2012-04-17
| | | | | | Not using full chain passed is ok as consumers are expected to check event's ready flag to determine if another call is needed, not the returned size.
* IOV_MAX handling microoptimization.Maxim Dounin2012-04-17
| | | | | | | | We now stop on IOV_MAX iovec entries only if we are going to add new one, i.e. next buffer can't be coalesced into last iovec. This also fixes incorrect checks for trailer creation on FreeBSD and Mac OS X, header.nelts was checked instead of trailer.nelts.