1 --- curl-7.26.0/lib/Makefile.vc10
2 +++ misc/build/curl-7.26.0/lib/Makefile.vc10
3 @@ -116,7 +116,7 @@ LFLAGS = /nologo /machine:$(MACHINE)
4 SSLLIBS = libeay32.lib ssleay32.lib
7 -WINLIBS = ws2_32.lib wldap32.lib advapi32.lib
8 +WINLIBS = ws2_32.lib wldap32.lib advapi32.lib winhttp.lib
9 CFLAGS = $(CFLAGS) $(EXCFLAGS)
12 --- curl-7.26.0/lib/url.c
13 +++ misc/build/curl-7.26.0/lib/url.c
14 @@ -80,6 +80,10 @@ void idn_free (void *ptr);
15 int curl_win32_idn_to_ascii(const char *in, char **out);
16 #endif /* USE_LIBIDN */
25 @@ -4111,6 +4115,21 @@ static bool check_noproxy(const char* name, const char* no_proxy)
30 +static char* wstrToCstr( LPWSTR wStr )
35 + bufSize = WideCharToMultiByte(
36 + CP_ACP, 0, wStr, -1, NULL, 0, NULL, NULL );
37 + out = ( char* )malloc( bufSize * sizeof(char));
38 + WideCharToMultiByte( CP_ACP, 0, wStr, -1, out, bufSize, NULL, NULL );
44 /****************************************************************
45 * Detect what (if any) proxy to use. Remember that this selects a host
46 * name and is not limited to HTTP proxies only.
47 @@ -4119,6 +4138,7 @@ static bool check_noproxy(const char* name, const char* no_proxy)
48 static char *detect_proxy(struct connectdata *conn)
51 + char *no_proxy=NULL;
53 #ifndef CURL_DISABLE_HTTP
54 /* If proxy was not specified, we check for default proxy environment
55 @@ -4138,7 +4158,63 @@ static char *detect_proxy(struct connectdata *conn)
56 * For compatibility, the all-uppercase versions of these variables are
57 * checked if the lowercase versions don't exist.
59 - char *no_proxy=NULL;
61 + WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *ieProxyConfig;
62 + ieProxyConfig = (WINHTTP_CURRENT_USER_IE_PROXY_CONFIG*)
63 + malloc(sizeof(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG));
64 + if(WinHttpGetIEProxyConfigForCurrentUser(ieProxyConfig)) {
65 + if(!ieProxyConfig->fAutoDetect) {
70 + ieProxy = wstrToCstr(ieProxyConfig->lpszProxy);
71 + ieNoProxy = wstrToCstr(ieProxyConfig->lpszProxyBypass);
73 + /* Convert the ieNoProxy into a proper no_proxy value */
74 + if(NULL != ieNoProxy) {
75 + no_proxy = strdup(ieNoProxy);
76 + pos = strpbrk(no_proxy, "; ");
77 + while(NULL != pos) {
78 + no_proxy[pos-no_proxy] = ',';
79 + pos = strpbrk(no_proxy, "; ");
83 + if(!check_noproxy(conn->host.name, no_proxy)) {
84 + /* Look for the http proxy setting */
87 + if(NULL != ieProxy) {
88 + tok = strtok(ieProxy, ";");
89 + if(strchr(tok, '=') == NULL) {
90 + proxy = strdup(ieProxy);
94 + if(strncmp(tok, "http=", 5) == 0) {
95 + /* We found HTTP proxy value, then use it */
96 + proxy = strdup( tok + 5 );
98 + tok = strtok(NULL, ";");
100 + while(NULL != tok);
109 + /* TODO Handle the Proxy config Auto Detection case */
112 + GlobalFree( ieProxyConfig->lpszAutoConfigUrl );
113 + GlobalFree( ieProxyConfig->lpszProxy );
114 + GlobalFree( ieProxyConfig->lpszProxyBypass );
119 no_proxy=curl_getenv("no_proxy");
120 @@ -4189,6 +4265,7 @@ static char *detect_proxy(struct connectdata *conn)
122 } /* if(!check_noproxy(conn->host.name, no_proxy)) - it wasn't specified
127 #else /* !CURL_DISABLE_HTTP */