forked from diladele/squid-windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
squid-3-5-1.patch
199 lines (185 loc) · 8.02 KB
/
squid-3-5-1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
diff -rupN orig/squid-3.5.1-20150124-r13741/acinclude/os-deps.m4 squid-3.5.1-20150124-r13741/acinclude/os-deps.m4
--- orig/squid-3.5.1-20150124-r13741/acinclude/os-deps.m4 2015-01-19 00:26:56.000000000 +0100
+++ squid-3.5.1-20150124-r13741/acinclude/os-deps.m4 2015-01-29 00:18:27.158415900 +0100
@@ -240,7 +240,7 @@ SQUID_STATE_SAVE(maxfd)
int main(int argc, char **argv) {
FILE *fp;
int i,j;
-#if defined(__CYGWIN32__) || defined (__CYGWIN__)
+#if defined (__CYGWIN__)
/* getrlimit and sysconf returns bogous values on cygwin32.
* Number of fds is virtually unlimited in cygwin (sys/param.h)
* __CYGWIN32__ is deprecated.
@@ -389,7 +389,7 @@ int main(int argc, char **argv)
{
FILE *fp;
int fd,val=0;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
int len=sizeof(int);
WSADATA wsaData;
WSAStartup(2, &wsaData);
@@ -397,7 +397,7 @@ int main(int argc, char **argv)
socklen_t len=sizeof(socklen_t);
#endif
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
WSACleanup();
#else
@@ -439,7 +439,7 @@ int main(int argc, char **argv)
{
FILE *fp;
int fd,val=0;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
int len=sizeof(int);
WSADATA wsaData;
WSAStartup(2, &wsaData);
@@ -447,7 +447,7 @@ int main(int argc, char **argv)
socklen_t len=sizeof(socklen_t);
#endif
if ((fd = socket(AF_INET, SOCK_DGRAM, 0)) < 0) return 1;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
WSACleanup();
#else
@@ -489,7 +489,7 @@ int main(int argc, char **argv)
{
FILE *fp;
int fd,val=0;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
int len=sizeof(int);
WSADATA wsaData;
WSAStartup(2, &wsaData);
@@ -497,7 +497,7 @@ int main(int argc, char **argv)
socklen_t len=sizeof(socklen_t);
#endif
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
if (getsockopt(fd, SOL_SOCKET, SO_SNDBUF, (char *)&val, &len) < 0) return 1;
WSACleanup();
#else
@@ -543,7 +543,7 @@ int main(int argc, char **argv)
{
FILE *fp;
int fd,val=0;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
int len=sizeof(int);
WSADATA wsaData;
WSAStartup(2, &wsaData);
@@ -551,7 +551,7 @@ int main(int argc, char **argv)
socklen_t len=sizeof(socklen_t);
#endif
if ((fd = socket(AF_INET, SOCK_STREAM, 0)) < 0) return 1;
-#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !(defined(__CYGWIN32__) || defined(__CYGWIN__))
+#if (defined(WIN32) || defined(__WIN32__) || defined(__WIN32)) && !defined(__CYGWIN__)
if (getsockopt(fd, SOL_SOCKET, SO_RCVBUF, (char *)&val, &len) < 0) return 1;
WSACleanup();
#else
diff -rupN orig/squid-3.5.1-20150124-r13741/compat/osdetect.h squid-3.5.1-20150124-r13741/compat/osdetect.h
--- orig/squid-3.5.1-20150124-r13741/compat/osdetect.h 2015-01-19 00:26:56.000000000 +0100
+++ squid-3.5.1-20150124-r13741/compat/osdetect.h 2015-01-29 00:20:08.313329500 +0100
@@ -72,9 +72,8 @@
#elif defined(__DragonFly__)
#define _SQUID_DRAGONFLY_ 1
-#elif defined(__CYGWIN32__) || defined(__CYGWIN__)
+#elif defined(__CYGWIN__)
#define _SQUID_CYGWIN_ 1
-#define _SQUID_WINDOWS_ 1
#elif defined(__MINGW32__) || defined(__MINGW__)
#define _SQUID_MINGW_ 1
diff -rupN orig/squid-3.5.1-20150124-r13741/configure.ac squid-3.5.1-20150124-r13741/configure.ac
--- orig/squid-3.5.1-20150124-r13741/configure.ac 2015-01-19 00:27:17.000000000 +0100
+++ squid-3.5.1-20150124-r13741/configure.ac 2015-01-29 02:14:19.920514300 +0100
@@ -100,7 +100,7 @@ if test "x$squid_host_os" != "xmingw" ;
case "$CXX" in
*clang++*) ;; #do nothing
*)
- AX_CXX_COMPILE_STDCXX_11([noext],[optional])
+ AX_CXX_COMPILE_STDCXX_11([ext],[optional])
esac
fi
@@ -215,7 +215,7 @@ fi
AC_SUBST(CGIEXT)
AM_CONDITIONAL(ENABLE_WIN32SPECIFIC,
- [test "x$squid_host_os" = "xmingw" -o "x$squid_host_os" = "xcygwin"])
+ [test "x$squid_host_os" = "xmingw"])
AM_CONDITIONAL(ENABLE_WIN32_IPC,[test "x$squid_host_os" = "xmingw"])
case "$squid_host_os" in
@@ -1132,10 +1132,10 @@ SQUID_YESNO([$enableval],[--disable-eui
])
if test "x${enable_eui:=yes}" = "xyes" ; then
case "$squid_host_os" in
- linux|solaris|freebsd|openbsd|netbsd)
+ linux|solaris|freebsd|openbsd|netbsd|cygwin)
${TRUE}
;;
- cygwin|mingw)
+ mingw)
EUILIB="-liphlpapi"
;;
*)
diff -rupN orig/squid-3.5.1-20150124-r13741/src/comm.cc squid-3.5.1-20150124-r13741/src/comm.cc
--- orig/squid-3.5.1-20150124-r13741/src/comm.cc 2015-01-19 00:26:56.000000000 +0100
+++ squid-3.5.1-20150124-r13741/src/comm.cc 2015-01-29 00:28:29.955192700 +0100
@@ -1089,18 +1089,12 @@ commSetNonBlocking(int fd)
#if _SQUID_WINDOWS_
int nonblocking = TRUE;
-#if _SQUID_CYGWIN_
- if (fd_table[fd].type != FD_PIPE) {
-#endif
if (ioctl(fd, FIONBIO, &nonblocking) < 0) {
debugs(50, 0, "commSetNonBlocking: FD " << fd << ": " << xstrerror() << " " << fd_table[fd].type);
return Comm::COMM_ERROR;
}
-#if _SQUID_CYGWIN_
- } else {
-#endif
#endif
#if !_SQUID_WINDOWS_
@@ -1115,9 +1109,6 @@ commSetNonBlocking(int fd)
}
#endif
-#if _SQUID_CYGWIN_
- }
-#endif
fd_table[fd].flags.nonblocking = true;
return 0;
diff -rupN orig/squid-3.5.1-20150124-r13741/src/dns_internal.cc squid-3.5.1-20150124-r13741/src/dns_internal.cc
--- orig/squid-3.5.1-20150124-r13741/src/dns_internal.cc 2015-01-19 00:26:56.000000000 +0100
+++ squid-3.5.1-20150124-r13741/src/dns_internal.cc 2015-01-29 00:30:18.583487500 +0100
@@ -389,10 +389,6 @@ idnsParseResolvConf(void)
return false;
}
-#if _SQUID_CYGWIN_
- setmode(fileno(fp), O_TEXT);
-#endif
-
char buf[RESOLV_BUFSZ];
const char *t = NULL;
while (fgets(buf, RESOLV_BUFSZ, fp)) {
diff -rupN orig/squid-3.5.1-20150124-r13741/src/tools.cc squid-3.5.1-20150124-r13741/src/tools.cc
--- orig/squid-3.5.1-20150124-r13741/src/tools.cc 2015-01-24 06:25:32.000000000 +0100
+++ squid-3.5.1-20150124-r13741/src/tools.cc 2015-02-02 23:24:13.883773400 +0100
@@ -896,7 +896,7 @@ setSystemLimits(void)
}
#endif /* HAVE_SETRLIMIT */
-#if HAVE_SETRLIMIT && defined(RLIMIT_DATA)
+#if HAVE_SETRLIMIT && defined(RLIMIT_DATA) && !_SQUID_CYGWIN_
if (getrlimit(RLIMIT_DATA, &rl) < 0) {
debugs(50, DBG_CRITICAL, "getrlimit: RLIMIT_DATA: " << xstrerror());
} else if (rl.rlim_max > rl.rlim_cur) {
@@ -912,7 +912,7 @@ setSystemLimits(void)
debugs(50, DBG_IMPORTANT, "NOTICE: Could not increase the number of filedescriptors");
}
-#if HAVE_SETRLIMIT && defined(RLIMIT_VMEM)
+#if HAVE_SETRLIMIT && defined(RLIMIT_VMEM) && !_SQUID_CYGWIN_
if (getrlimit(RLIMIT_VMEM, &rl) < 0) {
debugs(50, DBG_CRITICAL, "getrlimit: RLIMIT_VMEM: " << xstrerror());
} else if (rl.rlim_max > rl.rlim_cur) {