Latest update - 7371

This commit is contained in:
2018-10-04 08:46:41 +09:00
parent 38f6613705
commit 69e6ad19cd
11 changed files with 101 additions and 1 deletions
+13 -1
View File
@@ -20,7 +20,7 @@ static ngx_int_t ngx_event_connect_set_transparent(ngx_peer_connection_t *pc,
ngx_int_t
ngx_event_connect_peer(ngx_peer_connection_t *pc)
{
int rc, type;
int rc, type, value;
#if (NGX_HAVE_IP_BIND_ADDRESS_NO_PORT || NGX_LINUX)
in_port_t port;
#endif
@@ -73,6 +73,18 @@ ngx_event_connect_peer(ngx_peer_connection_t *pc)
}
}
if (pc->so_keepalive) {
value = 1;
if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE,
(const void *) &value, sizeof(int))
== -1)
{
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
"setsockopt(SO_KEEPALIVE) failed, ignored");
}
}
if (ngx_nonblocking(s) == -1) {
ngx_log_error(NGX_LOG_ALERT, pc->log, ngx_socket_errno,
ngx_nonblocking_n " failed");
+1
View File
@@ -62,6 +62,7 @@ struct ngx_peer_connection_s {
unsigned cached:1;
unsigned transparent:1;
unsigned so_keepalive:1;
/* ngx_connection_log_error_e */
unsigned log_error:2;