summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-09-01Events: processing of posted events changed from LIFO to FIFO.Valentin Bartenev1-2/+2
In theory, this can provide a bit better distribution of latencies. Also it simplifies the code, since ngx_queue_t is now used instead of custom implementation.
2014-09-01Events: removed broken thread support from posted events.Valentin Bartenev2-31/+1
It's mostly dead code. And the idea of thread support for this task has been deprecated.
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-08-05Version bump.Maxim Dounin1-2/+2
2014-08-01Core: improved ngx_pstrdup() error handling.Tatsuhiko Kubo1-0/+3
2014-06-26Core: use uppercase hexadecimal digits for percent-encoding.Piotr Sikora1-1/+1
RFC3986 says that, for consistency, URI producers and normalizers should use uppercase hexadecimal digits for all percent-encodings. This is also what modern web browsers and other tools use. Using lowercase hexadecimal digits makes it harder to interact with those tools in case when use of the percent-encoded URI is required, for example when $request_uri is part of the cache key. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
2014-07-24Core: fixed default log initialization.Vladimir Homutov1-4/+6
The ngx_log_insert() function may invalidate pointer passed to it, so make sure to don't use it after the ngx_log_insert() call.
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-06-18Core: bugfix for the ngx_slab_max_size case.Jianjun Zheng1-1/+1
2014-07-09Style: use ngx_str_null().Tatsuhiko Kubo1-2/+1
2014-07-09Style: use ngx_strlen() instead of strlen().Tatsuhiko Kubo1-1/+1
2014-07-09Version bump.Maxim Dounin1-2/+2
2014-06-26Core: removed meaningless check from ngx_palloc_block().Maxim Dounin1-7/+3
The check became meaningless after refactoring in 2a92804f4109. With the loop currently in place, "current" can't be NULL, hence the check can be dropped. Additionally, the local variable "current" was removed to simplify code, and pool->current now used directly instead. Found by Coverity (CID 714236).
2014-06-26Core: plugged socket leak during configuration test.Maxim Dounin1-6/+6
This isn't really important as configuration testing shortly ends with a process termination which will free all sockets, though Coverity complains. Prodded by Coverity (CID 400872).
2014-06-04Core: added ngx_slab_calloc() and ngx_slab_calloc_locked().Ruslan Ermilov2-0/+31
These functions return zeroed memory, analogous to ngx_pcalloc().
2014-06-18Version bump.Ruslan Ermilov1-2/+2
2014-06-03Core: slab allocator free pages defragmentation.Maxim Dounin2-1/+60
Large allocations from a slab pool result in free page blocks being fragmented, eventually leading to a situation when no further allocation larger than a page size are possible from the pool. While this isn't a problem for nginx itself, it is known to be bad for various 3rd party modules. Fix is to merge adjacent blocks of free pages in the ngx_slab_free_pages() function. Prodded by Wandenberg Peixoto and Yichun Zhang.
2014-05-28Version bump.Maxim Dounin1-2/+2
2014-05-27Syslog: fixed message sending on win32.Vladimir Homutov1-0/+4
2014-05-26Syslog: fixed possible resource leak and more verbose logging.Vladimir Homutov1-12/+22
Found by Coverity (CID 1215646).
2014-05-12Added syslog support for error_log and access_log directives.Vladimir Homutov7-16/+461
2014-05-20Configure: the --build= option.Ruslan Ermilov2-1/+7
If set, its value is output in "nginx -v" and in the error log.
2014-05-14Core: use '\r' for CR and '\n' for LF definitions.Ruslan Ermilov1-3/+3
2014-04-30Core: improved ngx_conf_parse() error handling.Maxim Dounin1-1/+1
Previous code failed to properly restore cf->conf_file in case of ngx_close_file() errors, potentially resulting in double free of cf->conf_file->buffer->start. Found by Coverity (CID 1087507).
2014-04-30Core: fixed error handling in ngx_reopen_files().Maxim Dounin1-0/+6
Found by Coverity (CID 1087509).
2014-04-24Version bump.Valentin Bartenev1-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