Changeset 74377 in vbox for trunk/src/VBox/Runtime/generic/http-curl.cpp
- Timestamp:
- Sep 20, 2018 12:37:23 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/http-curl.cpp
r74370 r74377 575 575 AssertMsgReturn(rcCurl == CURLE_OK, ("CURLOPT_PROXYTYPE=%d: %d (%#x)\n", enmProxyType, rcCurl, rcCurl), 576 576 VERR_HTTP_CURL_PROXY_CONFIG); 577 pThis->enmProxyType = CURLPROXY_HTTP;577 pThis->enmProxyType = enmProxyType; 578 578 } 579 579 … … 829 829 char *pszPassword = RTUriParsedAuthorityPassword(pszProxyUrl, &Parsed); 830 830 uint32_t uProxyPort = RTUriParsedAuthorityPort(pszProxyUrl, &Parsed); 831 bool fUnknownProxyType = false; 831 832 curl_proxytype enmProxyType; 832 833 if (RTUriIsSchemeMatch(pszProxyUrl, "http")) … … 836 837 uProxyPort = 80; 837 838 } 839 #if CURL_AT_LEAST_VERSION(7,52,0) 840 else if (RTUriIsSchemeMatch(pszProxyUrl, "https")) 841 { 842 enmProxyType = CURLPROXY_HTTPS; 843 if (uProxyPort == UINT32_MAX) 844 uProxyPort = 443; 845 } 846 #endif 838 847 else if ( RTUriIsSchemeMatch(pszProxyUrl, "socks4") 839 848 || RTUriIsSchemeMatch(pszProxyUrl, "socks")) … … 847 856 else 848 857 { 858 fUnknownProxyType = true; 849 859 enmProxyType = CURLPROXY_HTTP; 850 860 if (uProxyPort == UINT32_MAX) … … 857 867 858 868 rc = rtHttpUpdateProxyConfig(pThis, enmProxyType, pszHost, uProxyPort, pszUsername, pszPassword); 869 if (RT_SUCCESS(rc) && fUnknownProxyType) 870 rc = VWRN_WRONG_TYPE; 859 871 860 872 RTStrFree(pszUsername); … … 871 883 RTMemTmpFree(pszFreeMe); 872 884 return rc; 885 } 886 887 888 RTR3DECL(int) RTHttpSetProxyByUrl(RTHTTP hHttp, const char *pszUrl) 889 { 890 PRTHTTPINTERNAL pThis = hHttp; 891 RTHTTP_VALID_RETURN(pThis); 892 AssertPtrNullReturn(pszUrl, VERR_INVALID_PARAMETER); 893 AssertReturn(!pThis->fBusy, VERR_WRONG_ORDER); 894 895 if (!pszUrl || !*pszUrl) 896 return RTHttpUseSystemProxySettings(pThis); 897 if (RTStrNICmpAscii(pszUrl, RT_STR_TUPLE("direct://")) == 0) 898 return rtHttpUpdateAutomaticProxyDisable(pThis); 899 return rtHttpConfigureProxyFromUrl(pThis, pszUrl); 873 900 } 874 901
Note:
See TracChangeset
for help on using the changeset viewer.