[squid-dev] Bug fixes for mingw based on squid-3.5.0.4-20150106-r13714

Dennis dennis at infologika.com.br
Wed Jan 14 17:31:52 UTC 2015


Hello Amos

The changes are for used mingw32 32. But I also tried mingw64 32 and 
mingw64 64 with all different options. None really worked.

The mingw64 (32 and 64) seem to use ModSelect.cc and not 
ModSelectWin32.cc. When started it gives multiple lines with
"WARNING: FD xxxx has handlers, but it's invalid"
each line has an increasing number for xxxx. It consumes all possible 
numbers in a loop and then crashes.

And for mingw32 I get "I get: WARNING: Reply from unknown nameserver 
[::]:53" (as i wrote initially)

I already am working on other project and don't have much time to make 
the diffs again. I attached the diffs so it's a lot more readable 
without the line breaks. Please take a look it's actually very simple 
(changes are minor).

Thank you, and best regards,
Dennis Felippa


-----------------------------------------
Em (When): Tue, 13 Jan 2015 15:47:48 +1300
De (From): squid3 at treenet.co.nz
Para (To): dennis at infologika.com.br, squid-dev at lists.squid-cache.org
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 13/01/2015 8:09 a.m., Dennis wrote:
>> Dear Sirs
>>
>> I tried compiling squid-3.5.0.4-20150106-r13714 running under
>> windows with wingw
> Hi Dennis, thank you!
>
>> It still had a few bugs. I fixed them and now it compiles and runs,
>> but still can't resolve addresses (I have correctly specified the
>> name servers). I get: WARNING: Reply from unknown nameserver
>> [::]:53
>>
>> I don't have more time to work it further.
>>
>> I would like to contribute with the fixes I wrote. Here are them.
>>
>> Obs.: the diff shows squid-3.5.0.4 against
>> squid-3.5.0.4-20150106-r13714, but it is actually my
>> squid-3.5.0.4-20150106-r13714 against
>> squid-3.5.0.4-20150106-r13714
>>
>> configure command used: ./configure --enable-default-hostsfile=none
>> --prefix=C:/msys/1.0/squid mingw version: latest 32 bit.
> MinGW32 32-bit ? or MinGW-w64 32-bit ?
> I am finding there are some critical API differences between the two
> "MinGW" projects.
>
>> diffs:
>>
> Can you present these in unified format please? (diff -ur ...), and
> attachments rather than inline.
> It's very hard to read the other format around email quoting.
>
>> diff -r C:\msys\1.0\var\squid-3.5.0.4\compat\os\mswindows.h
>> C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\compat\os\mswindows.h
>>
>>
> 625,630c624,629
>> < /* commen out this function < inline char * < inet_ntop(int af,
>> const void *src, char *dst, size_t size) < { <     return
>> (char*)InetNtopA(af, const_cast<void*>(src), dst, size); < } <
>> #define inet_ntop(a,s,d,l) Squid::inet_ntop(a,s,d,l) */ ---
>>> inline char * inet_ntop(int af, const void *src, char *dst,
>>> size_t size) { return (char*)InetNtopA(af,
>>> const_cast<void*>(src), dst, size); } #define inet_ntop(a,s,d,l)
>>> Squid::inet_ntop(a,s,d,l)
> FYI: A fix for the re-definition error is about to be backported. But
> the absence of InetNtopA API call required by MS is still an issue I'm
> working on now.
>
> Amos
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2.0.22 (MingW32)
>
> iQEcBAEBAgAGBQJUtIdUAAoJELJo5wb/XPRjREIIAMx0UgbcS3lw8N2vFbuYhOt3
> J4s/+UVXJ4up5iq3MHtXKDK2tvDo3Bln9ZdAbUnXlrBdIZomDFMLfbU+6aToVFrL
> ACrmvJCFdoyBfjaSr1WONyf8mEifLfI/20gJWq5fRKw0OEiTNujfqTOvF+OBcLez
> JIkcMgjyhiwT3CITytXmVuFQxYzX/IAUQTHkf5axWUISyPbOIKFQ0lznMEaKHvC6
> tMklOnzDY3pIGYNi5tYKR76qs5vfuiCtxWWVMRt9976ABCViz5xatJyYO2d8Msrx
> FXmtjgie9rmX/AKkmffSTw9mW3Ls6J4/yF9G9YMa3ZSX5Yjf0G2OCeJHHjJIqTM=
> =hxHP
> -----END PGP SIGNATURE-----
>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150114/12526119/attachment.html>
-------------- next part --------------

Obs.: the diff shows squid-3.5.0.4 against squid-3.5.0.4-20150106-r13714, but it is actually my squid-3.5.0.4-20150106-r13714 against squid-3.5.0.4-20150106-r13714

configure command used:
./configure --enable-default-hostsfile=none --prefix=C:/msys/1.0/squid
mingw version: latest 32 bit.

diffs:


diff -r C:\msys\1.0\var\squid-3.5.0.4\compat\os\mswindows.h C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\compat\os\mswindows.h
625,630c624,629
< /* commen out this function
< inline char *
< inet_ntop(int af, const void *src, char *dst, size_t size)
< {
<     return (char*)InetNtopA(af, const_cast<void*>(src), dst, size);
< }
< #define inet_ntop(a,s,d,l) Squid::inet_ntop(a,s,d,l) */
---
> inline char *
> inet_ntop(int af, const void *src, char *dst, size_t size)
> {
>     return (char*)InetNtopA(af, const_cast<void*>(src), dst, size);
> }
> #define inet_ntop(a,s,d,l) Squid::inet_ntop(a,s,d,l)


***************************

diff -r C:\msys\1.0\var\squid-3.5.0.4\helpers\basic_auth\SSPI\valid.h C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\helpers\basic_auth\SSPI\valid.h
41d40
< typedef HANDLE SERVICE_STATUS_HANDLE;
74c73
< static const char *__foo;
---
> static char *__foo;
95d93
< int Valid_User(char *,char *, char *);


****************************  

  
diff -r C:\msys\1.0\var\squid-3.5.0.4\helpers\external_acl\LM_group\ext_lm_group_acl.ccC:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\helpers\external_acl\LM_group\ext_lm_group_acl.cc
95d94
< typedef HANDLE SERVICE_STATUS_HANDLE;


**************************************

diff -r C:\msys\1.0\var\squid-3.5.0.4\helpers\ntlm_auth\SSPI\ntlm_sspi_auth.cc C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\helpers\ntlm_auth\SSPI\ntlm_sspi_auth.cc
82d81
< typedef HANDLE SERVICE_STATUS_HANDLE;

 

*********************

squid-3.5.0.4-20150106-r13714

diff getaddrinfo.cc
26d25
< #include "../src/debug.h"
85c84
<     ret = (addrinfo*) malloc (sizeof (struct addrinfo));
---
>     ret = malloc (sizeof (struct addrinfo));
89c88
<     ret->ai_addr = (sockaddr*) malloc (addrlen);
---
>     ret->ai_addr = malloc (addrlen);
180c179
<         if (inet_pton(result.ai_family, nodename, &sin.sin_addr) != 1)
---
>         if (inet_pton(result.ai_family, nodename, &sin.sin_addr))
281c280
<         sai->ai_canonname = (char *) malloc (strlen (hp->h_name) + 1);
---
>         sai->ai_canonname = malloc (strlen (hp->h_name) + 1);

*****************

diff -r C:\msys\1.0\var\squid-3.5.0.4\compat\getnameinfo.cc C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\compat\getnameinfo.cc
151c151,159
< int xgetnameinfo(const struct sockaddr *sa, socklen_t salen, char *host, size_t hostlen, char *serv, size_t servlen, int flags)
---
> int
> xgetnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
> const struct sockaddr *sa;
> socklen_t salen;
> char *host;
> size_t hostlen;
> char *serv;
> size_t servlen;
> int flags;


******************

diff -r C:\msys\1.0\var\squid-3.5.0.4\compat\inet_ntop.cc C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\compat\inet_ntop.cc
97,98c97,98
< const char *inet_ntop4 (const u_char *src, char *dst, size_t size);
< const char *inet_ntop6 (const u_char *src, char *dst, size_t size);
---
> static const char *inet_ntop4 (const u_char *src, char *dst, size_t size);
> static const char *inet_ntop6 (const u_char *src, char *dst, size_t size);
107,112c108,113
< const char *
< xinet_ntop(af, src, dst, size)
< int af;
< const void *src;
< char *dst;
< size_t size;
---
> const char *
> xinet_ntop(af, src, dst, size)
> int af;
> const void *src;
> char *dst;
> size_t size;
114d113
< const char * xinet_ntop(int af, const void *src, char * dst, size_t size)
118c117
<         return (inet_ntop4((const u_char*) src, dst, size));
---
>         return (inet_ntop4(src, dst, size));
120c119
<         return (inet_ntop6((const u_char*) src, dst, size));
---
>         return (inet_ntop6(src, dst, size));
138,142c138,142
< static const char *
< inet_ntop4(src, dst, size)
< const u_char *src;
< char *dst;
< size_t size;
---
> static const char *
> inet_ntop4(src, dst, size)
> const u_char *src;
> char *dst;
> size_t size;
144d142
< const char * inet_ntop4( const u_char *src, char *dst, size_t size)
149c147
<     if ((size_t) snprintf(tmp, min(sizeof("255.255.255.255"),size), fmt, src[0], src[1], src[2], src[3]) >= size) {
---
>     if (snprintf(tmp, min(sizeof("255.255.255.255"),size), fmt, src[0], src[1], src[2], src[3]) >= size) {
162,166c161,165
< static const char *
< inet_ntop6(src, dst, size)
< const u_char *src;
< char *dst;
< size_t size;
---
> static const char *
> inet_ntop6(src, dst, size)
> const u_char *src;
> char *dst;
> size_t size;
168d165
< const char * inet_ntop6( const u_char *src, char *dst, size_t size)


***************

diff -r C:\msys\1.0\var\squid-3.5.0.4\compat\inet_pton.cc C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\compat\inet_pton.cc
106c106,110
< int xinet_pton( int af, const char *src, void *dst)
---
> int
> xinet_pton(af, src, dst)
> int af;
> const char *src;
> void *dst;
110c114
<         return (inet_pton4(src, (u_char*) dst));
---
>         return (inet_pton4(src, dst));
112c116
<         return (inet_pton6(src, (u_char*) dst));
---
>         return (inet_pton6(src, dst));
130c134,137
< static int inet_pton4( const char *src, u_char *dst)
---
> static int
> inet_pton4(src, dst)
> const char *src;
> u_char *dst;
144c150
<             u_int nw = *tp * 10 + (pch - digits);
---
>             u_int new = *tp * 10 + (pch - digits);
148c154
<             if (nw > 255)
---
>             if (new > 255)
150c156
<             *tp = nw;
---
>             *tp = new;
162c168
<             break; //return (0);
---
>             return (0);
183c189,192
< static int inet_pton6( const char *src, u_char *dst)
---
> static int
> inet_pton6(src, dst)
> const char *src;
> u_char *dst;
238c247
<         break; //return (0);
---
>         return (0);

***********************

diff -r C:\msys\1.0\var\squid-3.5.0.4\src\comm\ModSelectWin32.cc C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\src\comm\ModSelectWin32.cc
20d19
< #include "SquidConfig.h"
25d23
< #include "Globals.h"
278c276
<     incoming_udp_interval += Config.comm_incoming.udp.average - nevents;
---
>     incoming_udp_interval += Config.comm_incoming.udp_average - nevents;
310c308
<     incoming_tcp_interval += Config.comm_incoming.tcp.average - nevents;
---
>     incoming_tcp_interval += Config.comm_incoming.tcp_average - nevents;
338,339c336
<     int calldns = 0;
<     int calludp = 0, calltcp = 0;
---
>     int calldns = 0, callicp = 0, callhttp = 0;


*************************

diff -r C:\msys\1.0\var\squid-3.5.0.4\src\ipc_win32.cc C:\msys\1.0\var\squid-3.5.0.4-20150106-r13714\src\ipc_win32.cc
28,41d27
< #else
< #if HAVE_WINSOCK2_H
< #define SO_CONNDATA 0x7000
< #define SO_CONNOPT 0x7001
< #define SO_DISCDATA 0x7002
< #define SO_DISCOPT 0x7003
< #define SO_CONNDATALEN 0x7004
< #define SO_CONNOPTLEN 0x7005
< #define SO_DISCDATALEN 0x7006
< #define SO_DISCOPTLEN 0x7007
< #define SO_OPENTYPE 0x7008
< #define SO_SYNCHRONOUS_ALERT 0x10
< #define SO_SYNCHRONOUS_NONALERT 0x20
< #endif



More information about the squid-dev mailing list