--- curl/winbuild/MakefileBuild.vc.orig 2017-10-23 17:15:22.969492548 +0200 +++ curl/winbuild/MakefileBuild.vc 2017-10-23 17:16:38.491490679 +0200 @@ -72,7 +72,7 @@ CFLAGS_LIBCURL_STATIC = /DCURL_STATICLIB -WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib +WIN_LIBS = ws2_32.lib wldap32.lib advapi32.lib winhttp.lib BASE_NAME = libcurl BASE_NAME_DEBUG = $(BASE_NAME)_debug --- curl-7.26.0/lib/url.c +++ misc/build/curl-7.26.0/lib/url.c @@ -78,6 +78,10 @@ bool curl_win32_idn_to_ascii(const char *in, char **out); #endif /* USE_LIBIDN2 */ +#ifdef _WIN32 +#include +#endif + #include "urldata.h" #include "netrc.h" @@ -4586,6 +4590,21 @@ } #ifndef CURL_DISABLE_HTTP +#ifdef _WIN32 +static char *wstrToCstr(LPWSTR wStr) +{ + int bufSize; + char *out = NULL; + if(wStr != NULL) { + bufSize = WideCharToMultiByte( + CP_ACP, 0, wStr, -1, NULL, 0, NULL, NULL); + out = (char *)malloc(bufSize * sizeof(char)); + WideCharToMultiByte(CP_ACP, 0, wStr, -1, out, bufSize, NULL, NULL); + } + return out; +} +#endif + /**************************************************************** * Detect what (if any) proxy to use. Remember that this selects a host * name and is not limited to HTTP proxies only. @@ -4613,6 +4633,66 @@ * For compatibility, the all-uppercase versions of these variables are * checked if the lowercase versions don't exist. */ +#ifdef _WIN32 + char *no_proxy = NULL; + WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *ieProxyConfig; + ieProxyConfig = (WINHTTP_CURRENT_USER_IE_PROXY_CONFIG *) + malloc(sizeof(WINHTTP_CURRENT_USER_IE_PROXY_CONFIG)); + if(WinHttpGetIEProxyConfigForCurrentUser(ieProxyConfig)) { + if(!ieProxyConfig->fAutoDetect) { + char *ieProxy; + char *ieNoProxy; + char *pos; + + ieProxy = wstrToCstr(ieProxyConfig->lpszProxy); + ieNoProxy = wstrToCstr(ieProxyConfig->lpszProxyBypass); + + /* Convert the ieNoProxy into a proper no_proxy value */ + if(NULL != ieNoProxy) { + no_proxy = strdup(ieNoProxy); + pos = strpbrk(no_proxy, "; "); + while(NULL != pos) { + no_proxy[pos-no_proxy] = ','; + pos = strpbrk(no_proxy, "; "); + } + } + + if(!check_noproxy(conn->host.name, no_proxy)) { + /* Look for the http proxy setting */ + char *tok; + char *saveptr; + + if(NULL != ieProxy) { + tok = strtok_s(ieProxy, ";", &saveptr); + if(strchr(tok, '=') == NULL) { + proxy = strdup(ieProxy); + } + else { + do { + if(strncmp(tok, "http=", 5) == 0) { + /* We found HTTP proxy value, then use it */ + proxy = strdup(tok + 5); + } + tok = strtok_s(NULL, ";", &saveptr); + } + while(NULL != tok); + } + } + } + + free(ieProxy); + free(ieNoProxy); + } + else { + /* TODO Handle the Proxy config Auto Detection case */ + } + + GlobalFree(ieProxyConfig->lpszAutoConfigUrl); + GlobalFree(ieProxyConfig->lpszProxy); + GlobalFree(ieProxyConfig->lpszProxyBypass); + } + free(no_proxy); +#else /* !WIN32 */ char proxy_env[128]; const char *protop = conn->handler->scheme; char *envp = proxy_env; @@ -4663,6 +4739,7 @@ if(!proxy) proxy = curl_getenv("ALL_PROXY"); } +#endif /* WIN32 */ return proxy; } collabora/cp-4.0 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sc/source/ui/unoobj/linkuno.cxx
AgeCommit message (Expand)Author
2023-10-11Drop o3tl::span, can use C++20 std::span directly nowStephan Bergmann
2023-08-19loplugin: new global analysis locking2Noel Grandin
2023-06-18Use getXWeak in scMike Kaganski
2022-08-07clang-tidy modernize-pass-by-value in scNoel Grandin
2022-07-25use more o3tl::spanNoel Grandin
2022-07-14loplugin:moveitNoel Grandin