summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-07-26Version bump.Vladimir Homutov1-2/+2
2016-07-07Avoid left-shifting integers into the sign bit, which is undefined.Sergey Kandaurov1-2/+2
Found with UndefinedBehaviorSanitizer.
2016-07-06Use NGX_MAX_PATH_LEVEL where appropriate.Ruslan Ermilov2-12/+11
The macro was unused since 0.7.44.
2016-07-06Version bump.Ruslan Ermilov1-2/+2
2016-06-30Internal md5 and sha1 implementations are now always used.Maxim Dounin5-75/+0
This reduces the number of moving parts in ABI compatibility checks. Additionally, it also allows to use OpenSSL in FIPS mode while still using md5 for non-security tasks.
2016-06-29Removed unused flag accept_context_updated from ngx_event_t.Ruslan Ermilov1-4/+0
Also, removed practically unused flag accept_context_updated from ngx_connection_t.
2016-06-20Fixed build on MSVC.Roman Arutyunyan1-1/+1
2016-06-20Introduced ngx_inet_get_port() and ngx_inet_set_port() functions.Roman Arutyunyan4-44/+68
2016-06-09An internal SHA1 implementation.Maxim Dounin3-13/+319
2016-06-07Version bump.Sergey Kandaurov1-2/+2
2016-05-24Version bump.Valentin Bartenev1-2/+2
2016-05-24Fixed build on MSVC.Maxim Dounin1-2/+2
2016-05-23Realip: port support in X-Real-IP and X-Forwarded-For.Dmitry Volyntsev2-0/+81
Now, the module extracts optional port which may accompany an IP address. This custom extension is introduced, among other things, in order to facilitate logging of original client ports. Addresses with ports are expected to be in the RFC 3986 format, that is, with IPv6 addresses in square brackets. E.g., "X-Real-IP: [2001:0db8::1]:12345" sets client port ($remote_port) to 12345.
2016-05-23Added the $proxy_protocol_port variable.Dmitry Volyntsev2-4/+38
2016-05-23Introduced the ngx_sockaddr_t type.Ruslan Ermilov4-42/+45
It's properly aligned and can hold any supported sockaddr.
2016-05-20Belatedly changed the ngx_create_listening() prototype.Ruslan Ermilov2-2/+3
The function is called only with "struct sockaddr *" since 0.7.58.
2016-05-11Removed a surplus condition from ngx_parse_inet6_url().Ruslan Ermilov1-33/+30
No functional changes, since the condition was always true.
2016-05-11Core: fixed port handling in ngx_parse_inet6_url().Valentin Bartenev1-1/+6
This fixes buffer over-read when no port is specified in cases similar to 5df5d7d771f6, and catches missing port separator.
2016-04-28Removed unused flag unexpected_eof from ngx_connection_t.Ruslan Ermilov1-1/+0
2016-04-26Removed some bitrot.Ruslan Ermilov2-2/+0
Removed NGX_CONF_MULTI unused since 1.3.4. Removed ngx_url_t.one_addr unused since 1.3.10.
2016-04-26Version bump.Ruslan Ermilov1-2/+2
2016-04-19Thread pools: memory barriers in task completion notifications.Maxim Dounin1-0/+4
The ngx_thread_pool_done object isn't volatile, and at least some compilers assume that it is permitted to reorder modifications of volatile and non-volatile objects. Added appropriate ngx_memory_barrier() calls to make sure all modifications will happen before the lock is released. Reported by Mindaugas Rasiukevicius, http://mailman.nginx.org/pipermail/nginx-devel/2016-April/008160.html.
2016-04-12Fixed NGX_CONF_TAKE1/NGX_CONF_FLAG misuse (as in e444e8f6538b).Ruslan Ermilov1-1/+1
2016-04-08Removed redundant "u" format specifier.Ruslan Ermilov2-3/+3
It is implied for "x" and "X".
2016-04-07Version bump.Ruslan Ermilov1-2/+2
2016-04-01Core: removed incorrect GCC 2.7 check.Maxim Dounin1-5/+0
It was broken since introduction (__GNU__ instead of __GNUC__) and did nothing. Moreover, GCC 2.7 is happy with the normal version of the code. Reported by Joel Cunningham, http://mailman.nginx.org/pipermail/nginx-devel/2016-March/007964.html.
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-31Removed the prototype mysql module.Ruslan Ermilov2-3/+2
2016-03-31Fixed ngx_os_signal_process() prototype.Ruslan Ermilov1-2/+2
2016-03-31Fixed format specifiers in ngx_sprintf().Sergey Kandaurov2-3/+3
2016-03-31Fixed logging.Sergey Kandaurov4-7/+8
2016-03-31Fixed logging with variable field width.Sergey Kandaurov1-1/+1
2016-03-31Fixed logging in close error handling.Sergey Kandaurov1-1/+1
2016-03-30Style.Ruslan Ermilov11-83/+83
2016-03-30Version bump.Ruslan Ermilov1-2/+2
2016-03-29Win32: additional error code NGX_EEXIST_FILE (ticket #910).Maxim Dounin1-2/+2
On Windows there are two possible error codes which correspond to the EEXIST error code: ERROR_FILE_EXISTS used by CreateFile(CREATE_NEW), and ERROR_ALREADY_EXISTS used by CreateDirectory(). MoveFile() seems to use both: ERROR_ALREADY_EXISTS when moving within one filesystem, and ERROR_FILE_EXISTS when copying a file to a different drive.
2016-02-26Core: allow strings without null-termination in ngx_parse_url().Piotr Sikora1-2/+4
This fixes buffer over-read while using variables in the "proxy_pass", "fastcgi_pass", "scgi_pass", and "uwsgi_pass" directives, where result of string evaluation isn't null-terminated. Found with MemorySanitizer. Signed-off-by: Piotr Sikora <piotrsikora@google.com>
2016-03-25Fixed socket inheritance on reload and binary upgrade.Roman Arutyunyan2-0/+20
On nginx reload or binary upgrade, an attempt is made to inherit listen sockets from the previous configuration. Previously, no check for socket type was made and the inherited socket could have the wrong type. On binary upgrade, socket type was not detected at all. Wrong socket type could lead to errors on that socket due to different logic and unsupported syscalls. For example, a UDP socket, inherited as TCP, lead to the following error after arrival of a datagram: "accept() failed (102: Operation not supported on socket)".
2016-03-23Win32: fixed build after 384154fc634f.Dmitry Volyntsev1-3/+2
2016-03-23Resolver: added support for SRV records.Dmitry Volyntsev2-26/+991
2016-03-23Resolver: do not enable resolve timer if provided timeout is zero.Dmitry Volyntsev1-20/+24
2016-03-23Resolver: introduced valid field in resolver responses.Dmitry Volyntsev2-0/+8
It hints the amount of time a response could be considered as valid.
2016-03-23Core: introduced the NGX_DEBUG_PALLOC macro.Valentin Bartenev1-0/+4
It allows to turn off accumulation of small pool allocations into a big preallocated chunk of memory. This is useful for debugging memory access with sanitizer, since such accumulation can cover buffer overruns from being detected.
2016-03-23Core: use ngx_palloc_small() to allocate ngx_pool_large_t.Valentin Bartenev1-2/+2
This structure cannot be allocated as a large block anyway, otherwise that will result in infinite recursion, since each large allocation requires to allocate another ngx_pool_large_t. The room for the structure is guaranteed by the NGX_MIN_POOL_SIZE constant.
2016-03-23Core: introduced the ngx_palloc_small() function.Valentin Bartenev1-33/+26
It deduplicates some code for allocations from memory pool. No functional changes.
2016-03-23Core: moved logging before freeing large blocks of pool.Valentin Bartenev1-9/+10
This fixes use-after-free memory access with enabled debug log when pool->log is allocated as a large block.
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-03-18Threads: offloading of temp files writing to thread pools.Maxim Dounin2-0/+10
The ngx_thread_write_chain_to_file() function introduced, which uses ngx_file_t thread_handler, thread_ctx and thread_task fields. The task context structure (ngx_thread_file_ctx_t) is the same for both reading and writing, and can be safely shared as long as operations are serialized. The task->handler field is now always set (and not only when task is allocated), as the same task can be used with different handlers. The thread_write flag is introduced in the ngx_temp_file_t structure to explicitly enable use of ngx_thread_write_chain_to_file() in ngx_write_chain_to_temp_file() when supported by caller. In collaboration with Valentin Bartenev.
2016-03-18Threads: task pointer stored in ngx_file_t.Maxim Dounin2-3/+9
This simplifies the interface of the ngx_thread_read() function. Additionally, most of the thread operations now explicitly set file->thread_task, file->thread_handler and file->thread_ctx, to facilitate use of thread operations in other places. (Potential problems remain with sendfile in threads though - it uses file->thread_handler as set in ngx_output_chain(), and it should not be overwritten to an incompatible one.) In collaboration with Valentin Bartenev.
2016-01-20Stream: UDP proxy.Roman Arutyunyan2-10/+86