Search
j0ke.net Open Build Service
>
Projects
>
home:kries
:
branches:internetx:projects:http
>
nginx
> nginx-unix-sockets.diff
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File nginx-unix-sockets.diff of Package nginx
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c index 4c18036..59998be 100644 --- a/src/core/ngx_inet.c +++ b/src/core/ngx_inet.c @@ -68,7 +68,9 @@ ngx_sock_ntop(struct sockaddr *sa, u_char *text, size_t len, ngx_uint_t port) size_t n; struct sockaddr_in6 *sin6; #endif - + struct sockaddr_un *sun; + size_t path_len; + switch (sa->sa_family) { case AF_INET: @@ -108,6 +110,17 @@ ngx_sock_ntop(struct sockaddr *sa, u_char *text, size_t len, ngx_uint_t port) return n; #endif + case AF_UNIX: + + sun = (struct sockaddr_un *) sa; + path_len = strlen(sun->sun_path); + if (path_len == 0) { + return ngx_snprintf(text, len, "(unknown)") - text; + } else { + ngx_copy(text, (const u_char *) sun->sun_path, path_len); + return path_len; + } + default: return 0; } diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c index 4930b50..5e3493e 100644 --- a/src/http/ngx_http_request.c +++ b/src/http/ngx_http_request.c @@ -2426,7 +2426,11 @@ ngx_http_set_keepalive(ngx_http_request_t *r) if (tcp_nodelay && clcf->tcp_nodelay - && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) + && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET + #if (NGX_HAVE_UNIX_DOMAIN) + && c->sockaddr->sa_family != AF_UNIX + #endif + ) { ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay"); diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 8c7f9a4..7ab60ab 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1957,7 +1957,13 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u) return; } - if (clcf->tcp_nodelay && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) { + if (clcf->tcp_nodelay + && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET + #if (NGX_HAVE_UNIX_DOMAIN) + && c->sockaddr->sa_family != AF_UNIX + #endif + ) + { ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay"); tcp_nodelay = 1;