1 --- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 17:15:22.969492548 +0200
2 +++ curl/winbuild/MakefileBuild.vc 2017-10-23 17:16:38.491490679 +0200
5 CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB
7 -WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib
8 +WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib crypt32.lib winhttp.lib
11 BASE_NAME_DEBUG = $(BASE_NAME)_debug
12 --- curl-7.26.0/lib/url.c
13 +++ misc/build/curl-7.26.0/lib/url.c
15 bool curl_win32_idn_to_ascii(const char *in, char **out);
16 #endif /* USE_LIBIDN2 */
25 @@ -4586,6 +4590,21 @@
28 #ifndef CURL_DISABLE_HTTP
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 @@ -4613,6 +4633,66 @@
48 * For compatibility, the all-uppercase versions of these variables are
49 * checked if the lowercase versions don't exist.
52 + char *no_proxy = NULL;
53 + WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *ieProxyConfig;
54 + ieProxyConfig = (WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *)
55 + malloc(sizeof(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG));
56 + if(WinHttpGetIEProxyConfigForCurrentUser(ieProxyConfig)) {
57 + if(!ieProxyConfig->fAutoDetect) {
62 + ieProxy = wstrToCstr(ieProxyConfig->lpszProxy);
63 + ieNoProxy = wstrToCstr(ieProxyConfig->lpszProxyBypass);
65 + /* Convert the ieNoProxy into a proper no_proxy value */
66 + if(NULL != ieNoProxy) {
67 + no_proxy = strdup(ieNoProxy);
68 + pos = strpbrk(no_proxy, "; ");
69 + while(NULL != pos) {
70 + no_proxy[pos-no_proxy] = ',';
71 + pos = strpbrk(no_proxy, "; ");
75 + if(!check_noproxy(conn->host.name, no_proxy)) {
76 + /* Look for the http proxy setting */
80 + if(NULL != ieProxy) {
81 + tok = strtok_s(ieProxy, ";", &saveptr);
82 + if(strchr(tok, '=') == NULL) {
83 + proxy = strdup(ieProxy);
87 + if(strncmp(tok, "http=", 5) == 0) {
88 + /* We found HTTP proxy value, then use it */
89 + proxy = strdup(tok + 5);
91 + tok = strtok_s(NULL, ";", &saveptr);
102 + /* TODO Handle the Proxy config Auto Detection case */
105 + GlobalFree(ieProxyConfig->lpszAutoConfigUrl);
106 + GlobalFree(ieProxyConfig->lpszProxy);
107 + GlobalFree(ieProxyConfig->lpszProxyBypass);
112 const char *protop = conn->handler->scheme;
113 char *envp = proxy_env;
114 @@ -4663,6 +4739,7 @@
117 infof(data, "Uses proxy env variable %s == '%s'", envp, proxy);