File nginx-unix-sockets.diff of Package proceed-nginx (Revision bb67283885496c250c5762fa7da80f39)
Currently displaying revision bb67283885496c250c5762fa7da80f39, show latest
x
1
diff --git a/src/core/ngx_inet.c b/src/core/ngx_inet.c
2
index 4c18036..59998be 100644
3
--- a/src/core/ngx_inet.c
4
+++ b/src/core/ngx_inet.c
5
6
size_t n;
7
struct sockaddr_in6 *sin6;
8
#endif
9
-
10
+ struct sockaddr_un *sun;
11
+ size_t path_len;
12
+
13
switch (sa->sa_family) {
14
15
case AF_INET:
16
17
return n;
18
#endif
19
20
+ case AF_UNIX:
21
+
22
+ sun = (struct sockaddr_un *) sa;
23
+ path_len = strlen(sun->sun_path);
24
+ if (path_len == 0) {
25
+ return ngx_snprintf(text, len, "(unknown)") - text;
26
+ } else {
27
+ ngx_copy(text, (const u_char *) sun->sun_path, path_len);
28
+ return path_len;
29
+ }
30
+
31
default:
32
return 0;
33
}
34
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
35
index 4930b50..5e3493e 100644
36
--- a/src/http/ngx_http_request.c
37
+++ b/src/http/ngx_http_request.c
38
39
40
if (tcp_nodelay
41
&& clcf->tcp_nodelay
42
- && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET)
43
+ && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET
44
+ #if (NGX_HAVE_UNIX_DOMAIN)
45
+ && c->sockaddr->sa_family != AF_UNIX
46
+ #endif
47
+ )
48
{
49
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
50
51
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
52
index 8c7f9a4..7ab60ab 100644
53
--- a/src/http/ngx_http_upstream.c
54
+++ b/src/http/ngx_http_upstream.c
55
56
return;
57
}
58
59
- if (clcf->tcp_nodelay && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) {
60
+ if (clcf->tcp_nodelay
61
+ && c->tcp_nodelay == NGX_TCP_NODELAY_UNSET
62
+ #if (NGX_HAVE_UNIX_DOMAIN)
63
+ && c->sockaddr->sa_family != AF_UNIX
64
+ #endif
65
+ )
66
+ {
67
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, c->log, 0, "tcp_nodelay");
68
69
tcp_nodelay = 1;
70