summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-17Overflow detection in ngx_inet_addr().Ruslan Ermilov1-2/+6
2015-03-17Core: overflow detection in ngx_parse_time() (ticket #732).Ruslan Ermilov1-16/+37
2015-03-17Refactored ngx_parse_time().Ruslan Ermilov1-3/+1
No functional changes.
2015-03-17Core: overflow detection in number parsing functions.Ruslan Ermilov2-52/+72
2015-03-17Core: expose maximum values of time_t and ngx_int_t.Ruslan Ermilov1-0/+3
These are needed to detect overflows.
2015-02-24Core: fixed potential buffer overrun when initializing hash.Maxim Dounin1-1/+1
Initial size as calculated from the number of elements may be bigger than max_size. If this happens, make sure to set size to max_size. Reported by Chris West.
2015-02-04Core: fixed a race resulting in extra sem_post()'s.Roman Arutyunyan1-1/+2
The mtx->wait counter was not decremented if we were able to obtain the lock right after incrementing it. This resulted in unneeded sem_post() calls, eventually leading to EOVERFLOW errors being logged, "sem_post() failed while wake shmtx (75: Value too large for defined data type)". To close the race, mtx->wait is now decremented if we obtain the lock right after incrementing it in ngx_shmtx_lock(). The result can become -1 if a concurrent ngx_shmtx_unlock() decrements mtx->wait before the added code does. However, that only leads to one extra iteration in the next call of ngx_shmtx_lock().
2014-11-20Resolver: fixed use-after-free memory access.Ruslan Ermilov1-4/+4
In 954867a2f0a6, we switched to using resolver node as the timer event data, so make sure we do not free resolver node memory until the corresponding timer is deleted.
2014-10-02Core: fixed buffer overrun when hash max_size reached.Yichun Zhang1-0/+2
2015-04-06Version bump.Maxim Dounin1-2/+2
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