summaryrefslogtreecommitdiffhomepage
path: root/src/core/ngx_connection.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2014-02-03Use ngx_socket_errno where appropriate.Piotr Sikora1-5/+5
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
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.
2013-12-19Fixed the first argument to getsockopt().Ruslan Ermilov1-2/+6
While here, always initialize the last argument.
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 Ermilov1-3/+8
2013-12-03Added support for TCP_FASTOPEN supported in Linux >= 3.7.1.Mathew Rodley1-0/+32
--- 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-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-09-04Win32: MinGW GCC compatibility.Maxim Dounin1-3/+3
Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
2013-07-25On DragonFlyBSD, TCP_KEEPIDLE and TCP_KEEPINTVL are in msecs.Ruslan Ermilov1-4/+16
Based on a patch by Sepherosa Ziehau.
2013-07-25Style: reuse one int variable in ngx_configure_listening_sockets().Ruslan Ermilov1-11/+8
No functional changes.
2013-07-11Core: fixed possible use of an uninitialized variable.Vladimir Homutov1-0/+2
The call to ngx_sock_ntop() in ngx_connection_local_sockaddr() might be performed with the uninitialized "len" variable. The fix is to initialize variable to the size of corresponding socket address type. The issue was introduced in commit 05ba5bce31e0.
2013-07-11Core: extended ngx_sock_ntop() with socklen parameter.Vladimir Homutov1-3/+4
On Linux, sockaddr length is required to process unix socket addresses properly due to unnamed sockets (which don't have sun_path set at all) and abstract namespace sockets.
2013-03-25Use NGX_FILE_ERROR for handling file operations errors.Valentin Bartenev1-2/+2
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-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 Bartenev1-5/+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.
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-07-30Core: ipv6only is now on by default.Ruslan Ermilov1-2/+2
There is a general consensus that this change results in better consistency between different operating systems and differently tuned operating systems. Note: this changes the width and meaning of the ipv6only field of the ngx_listening_t structure. 3rd party modules that create their own listening sockets might need fixing.
2012-04-03Fixed spelling in multiline C comments.Ruslan Ermilov1-1/+1
2012-03-05Whitespace fixes.Maxim Dounin1-1/+1
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2011-12-05Added the "so_keepalive=" parameter to the "listen" directive.Valentin Bartenev1-0/+51
The "so_keepalive" directive in mail module was deprecated. Thanks to Vsevolod Stakhov for initial work.
2011-08-21Move SO_ACCEPTFILTER and TCP_DEFER_ACCEPT checks into configure.Maxim Dounin1-1/+1
NetBSD 5.0+ has SO_ACCEPTFILTER support merged from FreeBSD, and having accept filter check in FreeBSD-specific ngx_freebsd_config.h prevents it from being used on NetBSD. Therefore move the check into configure (and do the same for Linux-specific TCP_DEFER_ACCEPT, just to be in line).
2011-04-04reuse keepalive connections if there are no free worker connectionsIgor Sysoev1-0/+55
patch by Maxim Dounin
2010-07-05listen setfib=XIgor Sysoev1-0/+36
2010-05-31fix IPv6 and Unix domain sockets inheritance while online upgradeIgor Sysoev1-4/+2
2009-11-30chmod unix listen domain socket to 0666Igor Sysoev1-5/+16
2009-11-23add NGX_PROCESS_HELPER process statusIgor Sysoev1-1/+1
2009-11-04allow to inherit unix domain sockets while online upgradeIgor Sysoev1-2/+9
2009-11-01delete unused field c->local_socklenIgor Sysoev1-1/+0
2009-10-30do not unlink unix domain socket file while online upgradeIgor Sysoev1-1/+2
2009-10-30unlink unix domain socket file after testingIgor Sysoev1-0/+12
2009-10-26http listen unix domain socketsIgor Sysoev1-11/+34
2009-09-23low default connection errors level from alert to errorIgor Sysoev1-5/+1
2009-06-07update r2925Igor Sysoev1-0/+2
2009-05-18ngx_connection_local_sockaddr()Igor Sysoev1-0/+60
2009-05-05ngx_create_listening()Igor Sysoev1-0/+58
2009-05-05move listen log copying from ngx_open_listening_sockets()Igor Sysoev1-2/+2
to ngx_configure_listening_sockets(), otherwise listen socket logs have no file after first reload and this caused segfault if debug_connection was used; the bug has been introduced in r2786
2009-05-05use correct nameIgor Sysoev1-1/+1
2009-05-05use local variableIgor Sysoev1-2/+2
2009-05-04delete ngx_listening_inet_stream_socket()Igor Sysoev1-46/+0
2009-04-30*) refactor error_log processing: listen socket log might inherit built-inIgor Sysoev1-0/+2
error_log with zero level, and r2447, r2466, r2467 were not enough *) remove bogus "stderr" level *) some functions and fields renames
2009-04-29fix the previous commitIgor Sysoev1-7/+5
2009-04-29Winsock uses ECONNABORTED instead of ECONNRESETIgor Sysoev1-2/+13
2009-04-20Win32 master/workers modelIgor Sysoev1-15/+17
2009-03-13ipv6onlyIgor Sysoev1-0/+17
2009-03-12ignore EINVAL from setsockopt() on SolarisIgor Sysoev1-3/+8
2009-02-21a prelimiary IPv6 support, HTTP listenIgor Sysoev1-13/+17
2008-09-17fix grammarIgor Sysoev1-1/+1
2008-08-21ngx_sock_ntop() takes family from sockaddr, remove duplicate fieldIgor Sysoev1-5/+3