Skip to content

Commit

Permalink
Merge changes from dev clone.
Browse files Browse the repository at this point in the history
  • Loading branch information
manugarg committed Dec 12, 2010
2 parents 8f787ad + d9045bc commit b617363
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/Makefile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@ clean:
del /F pacparser.dll *.lib pacparser.def pacparser.exp pacparser.o pactester.exe libpacparser.a
$(MAKE) -C spidermonkey -f Makefile.win32 clean
cd pymod && setup.py clean
if exist dist rmdir /s /q dist
5 changes: 4 additions & 1 deletion src/pacparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ resolve_host(const char *hostname, char *ipaddr_list, int max_results)
char ipaddr[INET6_ADDRSTRLEN];
int error;

// Truncate ipaddr_list to an empty string.
ipaddr_list[0] = '\0';

#ifdef _WIN32
// On windows, we need to initialize the winsock dll first.
WSADATA WsaData;
Expand All @@ -118,7 +121,7 @@ resolve_host(const char *hostname, char *ipaddr_list, int max_results)
if (ipaddr_list[0] == '\0') sprintf(ipaddr_list, "%s", ipaddr);
else sprintf(ipaddr_list, "%s;%s", ipaddr_list, ipaddr);
}
freeaddrinfo(ai);
freeaddrinfo(result);
#ifdef _WIN32
WSACleanup();
#endif
Expand Down
4 changes: 2 additions & 2 deletions src/pymod/Makefile.win32
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ dist: build
copy ..\..\INSTALL dist\INSTALL.txt

clean:
if exist pacparser_py.o del pacparser_py.o
if exist _pacparser.pyd del _pacparser.pyd
del /F pacparser_py.o _pacparser.pyd
if exist dist rmdir /s /q dist
3 changes: 0 additions & 3 deletions tests/proxy.pac
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ function FindProxyForURL(url, host) {
if (/^https:\/\/.*$/.test(url))
return "secureUrl";

if (isInNet(myIpAddress(), '192.0.0.0', '255.0.0.0'))
return '192.0.0.0';

if (isInNet(myIpAddress(), '10.10.0.0', '255.255.0.0'))
return '10.10.0.0';

Expand Down
3 changes: 1 addition & 2 deletions tests/testdata
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Command Line Parameters|Expected Result
-u http://www.google.co.in|END-OF-SCRIPT
-c 0.0.0.0 -u http://www.google.co.in|END-OF-SCRIPT
-e -u http://www.google.com|dnsResolveEx defined
-u http://host1|plainhost/.manugarg.com
-u http://www1.manugarg.com|plainhost/.manugarg.com
-u http://manugarg.externaldomain.com|externaldomain
-u http://www.google.com|isResolvable
-u http://www.notresolvabledomainXXX.com|isNotResolvable
-u https://www.somehost.com|secureUrl
-c 192.168.101.1 -u http://www.somehost.com|192.0.0.0
-c 10.10.100.112 -u http://www.somehost.com|10.10.0.0

0 comments on commit b617363

Please sign in to comment.