summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-08-19Resolver: notify all waiting requests on timeout.Ruslan Ermilov1-8/+16
If a "resolver_timeout" occurs, only the first waiting request was notified. Other requests may hang forever.
2014-07-16Resolver: fixed resend on malformed responses.Ruslan Ermilov1-2/+27
DNS request resend on malformed responses was broken in 98876ce2a7fd (1.5.8). Reported by Pramod Korathota.
2014-09-15Version bump.Maxim Dounin1-2/+2
2014-08-05Version bump.Maxim Dounin1-2/+2
2014-04-18Version bump.Maxim Dounin1-2/+2
2014-04-08Version bump.Valentin Bartenev1-2/+2
2014-03-31Core: fixed hash to actually try max_size.Maxim Dounin1-1/+1
Previously, maximum size of a hash table built was (max_size - 1).
2014-03-31Core: hash now ignores bucket_size if it hits max_size limit.Maxim Dounin1-8/+5
2014-03-31Core: slab log_nomem flag.Maxim Dounin2-1/+7
The flag allows to suppress "ngx_slab_alloc() failed: no memory" messages from a slab allocator, e.g., if an LRU expiration is used by a consumer and allocation failures aren't fatal. The flag is now used in the SSL session cache code, and in the limit_req module.
2014-03-18Version bump.Maxim Dounin1-2/+2
2014-03-17Added server-side support for PROXY protocol v1 (ticket #355).Roman Arutyunyan4-0/+117
Client address specified in the PROXY protocol header is now saved in the $proxy_protocol_addr variable and can be used in the realip module. This is currently not implemented for mail.
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.
2014-03-06Fixed format specifier in logging of "c->number".Sergey Kandaurov1-1/+1
2014-03-04Version bump.Roman Arutyunyan1-2/+2
2014-02-22Core: allocate enough memory to hold IPv6 text address plus port.Ruslan Ermilov1-1/+1
2014-02-20Resolver: properly handle connect() failures.Ruslan Ermilov1-11/+11
If initial attempt to connect() the UDP socket failed, e.g. due to network unreachable, no further attempts were made.
2014-02-03Use ngx_socket_errno where appropriate.Piotr Sikora1-5/+5
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-02-05Version bump.Maxim Dounin1-2/+2
2014-02-04Core: added ngx_encode_base64url().Maxim Dounin2-12/+38
2014-01-30Core: handle getsockopt(TCP_FASTOPEN) failures.Piotr Sikora1-4/+8
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>
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-01-23Version bump.Maxim Dounin1-2/+2
2014-01-17Core: improved ngx_reset_pool() (ticket #490).Maxim Dounin1-2/+5
Previously pool->current wasn't moved back to pool, resulting in blocks not used for further allocations if pool->current was already moved at the time of ngx_reset_pool(). Additionally, to preserve logic of moving pool->current, the p->d.failed counters are now properly cleared. While here, pool->chain is also cleared. This change is essentially a nop with current code, but generally improves things.
2014-01-14SPDY: body filter was replaced by c->send_chain() function.Valentin Bartenev1-0/+3
It allows to use ngx_http_write_filter() and all its rate limiting logic.
2014-01-10Resolver: added support for domain names with a trailing dot.Yichun Zhang1-0/+4
2014-01-04Allowed up to two EBUSY errors from sendfile().Maxim Dounin1-0/+1
Fallback to synchronous sendfile() now only done on 3rd EBUSY without any progress in a row. Not falling back is believed to be better in case of occasional EBUSY, though protection is still needed to make sure there will be no infinite loop.
2013-12-19Fixed the first argument to getsockopt().Ruslan Ermilov1-2/+6
While here, always initialize the last argument.
2013-12-16Resolver: use minimum TTL for caching (ticket #329).Ruslan Ermilov1-6/+7
2013-12-18Version bump.Valentin Bartenev1-2/+2
2013-12-13Resolver: lookups are case-insensitive.Ruslan Ermilov1-3/+5
2013-12-09The "ipv6=" boolean parameter of the "resolver" directive.Ruslan Ermilov2-3/+36
When set to "off", only IPv4 addresses will be resolved, and no AAAA queries are ever sent.
2013-12-09Resolver: implemented IPv6 name to address resolving.Ruslan Ermilov2-60/+433
2013-12-06Resolver: implemented IPv6 address to name resolving.Ruslan Ermilov2-80/+398
2013-12-06Changed resolver API to use ngx_addr_t.Ruslan Ermilov2-79/+142
2013-12-13Resolver: fixed indentation.Ruslan Ermilov1-20/+20
2013-12-06Core: externalized ngx_cmp_sockaddr().Ruslan Ermilov3-70/+78
It's also extended with the "cmp_port" argument to indicate whether ports should be compared as well, or only addresses.
2013-12-06Resolver: fixes in PTR processing.Ruslan Ermilov1-5/+12
Verify that class of RR is "IN". Verify that RR data length is non-zero.
2013-12-06Resolver: fixes in A processing.Ruslan Ermilov1-14/+25
Verify that class of RR is "IN". Verify that RR data length is exactly four octets. Correctly shift to the next RR if RR type is unknown.
2013-12-06Resolver: fixed response processing.Ruslan Ermilov1-6/+5
Stricten response header checks: ensure that reserved bits are zeroes, and that the opcode is "standard query". Fixed the "zero-length domain name in DNS response" condition.
2013-12-06Resolver: removed unnecessary casts.Ruslan Ermilov1-2/+2
2013-12-06Resolver: improved code readability.Ruslan Ermilov1-69/+83
Renamed ngx_resolver_query_t to ngx_resolver_hdr_t as it describes the header that is common to DNS queries and answers. Replaced the magic number 12 by the size of the header structure. The other changes are self-explanatory.
2013-12-09Fixed handling of UNIX-domain sockets.Ruslan Ermilov1-0/+6
When evaluating $local_port, $server_port, and $server_addr, UNIX-domain sockets were mistakenly interpreted as IPv4 sockets.
2013-12-09Core: keep the length of the local sockaddr.Ruslan Ermilov2-3/+9
2013-12-03Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.Mathew Rodley2-0/+36
--- auto/unix | 12 ++++++++++++ src/core/ngx_connection.c | 32 ++++++++++++++++++++++++++++++++ src/core/ngx_connection.h | 4 ++++ src/http/ngx_http.c | 4 ++++ src/http/ngx_http_core_module.c | 21 +++++++++++++++++++++ src/http/ngx_http_core_module.h | 3 +++ 6 files changed, 76 insertions(+)
2013-11-29Version bump.Maxim Dounin1-2/+2
2013-10-31Core: handling of getsockopt(TCP_DEFER_ACCEPT) failures.Maxim Dounin1-2/+10
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.
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-10-02Version bump.Sergey Kandaurov1-2/+2
2013-09-23Added ngx_filename_cmp() with "/" sorted to the left.Maxim Dounin2-0/+41
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.
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==