Changeset 43679 in vbox
- Timestamp:
- Oct 18, 2012 12:26:04 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/iprt/http.h (modified) (1 diff)
-
src/VBox/Runtime/common/misc/http.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/http.h
r43645 r43679 73 73 RTR3DECL(int) RTHttpGet(RTHTTP hHttp, const char *pcszUrl, char **ppszResponse); 74 74 75 /** 76 * Specify proxy settings. 77 * 78 * @returns iprt status code. 79 * 80 * @param hHttp HTTP interface handle. 81 * @param pcszProxy URL of the proxy 82 * @param uPort port number of the proxy, use 0 for not specifying a port. 83 * @param pcszUser username, pass NULL for no authentication 84 * @param pcszPwd password, pass NULL for no authentication 85 */ 86 RTR3DECL(int) RTHttpSetProxy(RTHTTP hHttp, const char *pcszProxyUrl, uint32_t uPort, 87 const char *pcszProxyUser, const char *pcszProxyPwd); 88 75 89 /** @} */ 76 90 -
trunk/src/VBox/Runtime/common/misc/http.cpp
r43651 r43679 137 137 } 138 138 139 RTR3DECL(int) RTHttpSetProxy(RTHTTP hHttp, const char *pcszProxy, uint32_t uPort, 140 const char *pcszProxyUser, const char *pcszProxyPwd) 141 { 142 PRTHTTPINTERNAL pHttpInt = hHttp; 143 RTHTTP_VALID_RETURN(pHttpInt); 144 AssertPtrReturn(pcszProxy, VERR_INVALID_PARAMETER); 145 146 int rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXY, pcszProxy); 147 if (CURL_FAILED(rcCurl)) 148 return VERR_INVALID_PARAMETER; 149 150 if (uPort != 0) 151 { 152 rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXYPORT, (long)uPort); 153 if (CURL_FAILED(rcCurl)) 154 return VERR_INVALID_PARAMETER; 155 } 156 157 if (pcszProxyUser && pcszProxyPwd) 158 { 159 rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXYUSERNAME, pcszProxyUser); 160 if (CURL_FAILED(rcCurl)) 161 return VERR_INVALID_PARAMETER; 162 163 rcCurl = curl_easy_setopt(pHttpInt->pCurl, CURLOPT_PROXYPASSWORD, pcszProxyPwd); 164 if (CURL_FAILED(rcCurl)) 165 return VERR_INVALID_PARAMETER; 166 } 167 168 return VINF_SUCCESS; 169 } 170 139 171 RTR3DECL(int) RTHttpGet(RTHTTP hHttp, const char *pcszUrl, char **ppszResponse) 140 172 {
Note:
See TracChangeset
for help on using the changeset viewer.

