summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-01-28Fixed TCP_DEFER_ACCEPT handling (ticket #353).Maxim Dounin1-1/+7
Backed out 05a56ebb084a, as it turns out that kernel can return connections without any delay if syncookies are used. This basically means we can't assume anything about connections returned with deferred accept set. To solve original problem the 05a56ebb084a tried to solve, i.e. to don't wait longer than needed if a connection was accepted after deferred accept timeout, this patch changes a timeout set with setsockopt(TCP_DEFER_ACCEPT) to 1 second, unconditionally. This is believed to be enough for speed improvements, and doesn't imply major changes to timeouts used. Note that before 2.6.32 connections were dropped after a timeout. Though it is believed that 1s is still appropriate for kernels before 2.6.32, as previously tcp_synack_retries controlled the actual timeout and 1s results in more than 1 minute actual timeout by default.
2014-02-06Version bump.Maxim Dounin1-2/+2
2013-11-19Version bump.Maxim Dounin1-2/+2
2013-09-20Core: fix misallocation at ngx_crypt_apr1 (ticket #412).Markus Linnala1-1/+1
Found by using auth_basic.t from mdounin nginx-tests under valgrind. ==10470== Invalid write of size 1 ==10470== at 0x43603D: ngx_crypt_to64 (ngx_crypt.c:168) ==10470== by 0x43648E: ngx_crypt (ngx_crypt.c:153) ==10470== by 0x489D8B: ngx_http_auth_basic_crypt_handler (ngx_http_auth_basic_module.c:297) ==10470== by 0x48A24A: ngx_http_auth_basic_handler (ngx_http_auth_basic_module.c:240) ==10470== by 0x44EAB9: ngx_http_core_access_phase (ngx_http_core_module.c:1121) ==10470== by 0x44A822: ngx_http_core_run_phases (ngx_http_core_module.c:895) ==10470== by 0x44A932: ngx_http_handler (ngx_http_core_module.c:878) ==10470== by 0x455EEF: ngx_http_process_request (ngx_http_request.c:1852) ==10470== by 0x456527: ngx_http_process_request_headers (ngx_http_request.c:1283) ==10470== by 0x456A91: ngx_http_process_request_line (ngx_http_request.c:964) ==10470== by 0x457097: ngx_http_wait_request_handler (ngx_http_request.c:486) ==10470== by 0x4411EE: ngx_epoll_process_events (ngx_epoll_module.c:691) ==10470== Address 0x5866fab is 0 bytes after a block of size 27 alloc'd ==10470== at 0x4A074CD: malloc (vg_replace_malloc.c:236) ==10470== by 0x43B251: ngx_alloc (ngx_alloc.c:22) ==10470== by 0x421B0D: ngx_malloc (ngx_palloc.c:119) ==10470== by 0x421B65: ngx_pnalloc (ngx_palloc.c:147) ==10470== by 0x436368: ngx_crypt (ngx_crypt.c:140) ==10470== by 0x489D8B: ngx_http_auth_basic_crypt_handler (ngx_http_auth_basic_module.c:297) ==10470== by 0x48A24A: ngx_http_auth_basic_handler (ngx_http_auth_basic_module.c:240) ==10470== by 0x44EAB9: ngx_http_core_access_phase (ngx_http_core_module.c:1121) ==10470== by 0x44A822: ngx_http_core_run_phases (ngx_http_core_module.c:895) ==10470== by 0x44A932: ngx_http_handler (ngx_http_core_module.c:878) ==10470== by 0x455EEF: ngx_http_process_request (ngx_http_request.c:1852) ==10470== by 0x456527: ngx_http_process_request_headers (ngx_http_request.c:1283) ==10470==
2013-10-07Version bump.Maxim Dounin1-2/+2
2013-07-12Version bump.Maxim Dounin1-2/+2
2013-05-06Version bump.Maxim Dounin1-2/+2
2013-04-24Version bump.Maxim Dounin1-2/+2
2013-04-18Version bump.Ruslan Ermilov1-2/+2
2013-03-27Version bump.Maxim Dounin1-2/+2
2013-03-25Use NGX_FILE_ERROR for handling file operations errors.Valentin Bartenev4-6/+8
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-21Moved ngx_array_t definition from ngx_core.h to ngx_array.h.Ruslan Ermilov2-3/+2
2013-03-21Use NGX_DEFAULT_POOL_SIZE macro where appropriate.Ruslan Ermilov1-1/+1
2013-03-21Simplified ngx_array_create().Ruslan Ermilov1-7/+1
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.
2013-03-15Status: introduced the "ngx_stat_waiting" counter.Valentin Bartenev1-0/+8
And corresponding variable $connections_waiting was added. Previously, waiting connections were counted as the difference between active connections and the sum of reading and writing connections. That made it impossible to count more than one request in one connection as reading or writing (as is the case for SPDY). Also, we no longer count connections in handshake state as waiting.
2013-03-07Removed c->single_connection flag.Valentin Bartenev2-6/+3
The c->single_connection was intended to be used as lock mechanism to serialize modifications of request object from several threads working with client and upstream connections. The flag is redundant since threads in nginx have never been used that way.
2013-03-07Version bump.Valentin Bartenev1-2/+2
2013-02-19Version bump.Valentin Bartenev1-2/+2
2013-02-07Added support for {SHA} passwords (ticket #50).Maxim Dounin1-0/+37
Note: use of {SHA} passwords is discouraged as {SHA} password scheme is vulnerable to attacks using rainbow tables. Use of {SSHA}, $apr1$ or crypt() algorithms as supported by OS is recommended instead. The {SHA} password scheme support is added to avoid the need of changing the scheme recorded in password files from {SHA} to {SSHA} because such a change hides security problem with {SHA} passwords. Patch by Louis Opter, with minor changes.
2013-02-07Version bump.Maxim Dounin1-2/+2
2013-01-17Version bump.Ruslan Ermilov1-2/+2
2013-01-10Fixed "proxy_pass" with IP address and no port (ticket #276).Ruslan Ermilov1-10/+4
Upstreams created by "proxy_pass" with IP address and no port were broken in 1.3.10, by not initializing port in u->sockaddr. API change: ngx_parse_url() was modified to always initialize port (in u->sockaddr and in u->port), even for the u->no_resolve case; ngx_http_upstream() and ngx_http_upstream_add() were adopted.
2013-01-08The data pointer in ngx_open_file_t objects must be initialized.Valentin Bartenev1-0/+1
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).
2012-12-26Version bump.Ruslan Ermilov1-2/+2
2012-12-25Geo: IPv6 support.Ruslan Ermilov2-0/+206
The "ranges" mode is still limited to IPv4 only.
2012-12-23Reopening log files code moved to a separate function.Valentin Bartenev3-48/+6
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-22Properly initialize "struct in6_addr" with zeroes.Ruslan Ermilov1-1/+1
2012-12-20Fixed return type of internal function that allocates radix tree nodes.Ruslan Ermilov1-5/+5
2012-12-17Implemented IPv6 support for URLs specified using domain names.Ruslan Ermilov2-30/+211
This includes "debug_connection", upstreams, "proxy_pass", etc. (ticket #92) To preserve compatibility, "listen" specified with a domain name selects the first IPv4 address, if available. If not available, the first IPv6 address will be used (ticket #186).
2012-12-17Fixed URL parsing code.Ruslan Ermilov1-5/+5
The URL parsing code is not expected to initialize port from default port when in "no_resolve" mode. This got broken in r4671 for the case of IPv6 literals.
2012-12-17Simplified URL parsing code.Ruslan Ermilov1-30/+26
Except for the "listen" directive, "*" specified as a hostname is no longer treated specially.
2012-12-14Fixed handling of ngx_write_fd() and ngx_read_fd() errors.Valentin Bartenev3-6/+6
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-30Fixed the NGX_SOCKADDR_STRLEN macro definition.Ruslan Ermilov1-1/+1
The ngx_sock_ntop() function, when told to print both address and port, prints IPv6 address in square brackets, followed by colon and port.
2012-11-29Version bump.Maxim Dounin1-2/+2
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-11-21Fixed location of debug message in ngx_shmtx_lock().Ruslan Ermilov1-3/+3
2012-11-20Fixed failure to start cache manager and cache loader processesIgor Sysoev1-0/+2
if there were more than 512 listening sockets in configuration.
2012-11-16Version bump.Ruslan Ermilov1-2/+2
2012-10-24Resolver: added missing memory allocation error handling.Maxim Dounin1-0/+4
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-10-03Version bump.Maxim Dounin1-2/+2
2012-10-01OCSP stapling: loading OCSP responses.Maxim Dounin1-1/+1
This includes the ssl_stapling_responder directive (defaults to OCSP responder set in certificate's AIA extension). OCSP response for a given certificate is requested once we get at least one connection with certificate_status extension in ClientHello, and certificate status won't be sent in the connection in question. This due to limitations in the OpenSSL API (certificate status callback is blocking). Note: SSL_CTX_use_certificate_chain_file() was reimplemented as it doesn't allow to access the certificate loaded via SSL_CTX.
2012-09-28Resolver: cached addresses are returned with random rotation now.Maxim Dounin1-2/+25
This ensures balancing when working with dynamically resolved upstream servers with multiple addresses. Based on patch by Anton Jouline.
2012-09-28Correct plural form for "path" in the whole source base.Andrey Belov4-16/+16
2012-09-28Made sure to initialize the entire ngx_file_t structure.Andrey Belov1-0/+2
Found by Coverity.
2012-09-26Version bump.Maxim Dounin1-2/+2
2012-08-30Fixed overflow if ngx_slab_alloc() is called with very big "size" argument.Ruslan Ermilov1-2/+2
2012-08-28Fixed the "include" directive.Ruslan Ermilov2-2/+2
The "include" directive should be able to include multiple files if given a filename mask. Fixed this to work for "include" directives inside the "map" or "types" blocks. The "include" directive inside the "geo" block is still not fixed.