Support proxies and allow buffer size override
This commit is contained in:
Родитель
ef5fec0f70
Коммит
ac0680005d
|
@ -57,6 +57,10 @@
|
|||
#include "winhttppal.h"
|
||||
#endif
|
||||
|
||||
#ifndef WINHTTP_CURL_MAX_WRITE_SIZE
|
||||
#define WINHTTP_CURL_MAX_WRITE_SIZE CURL_MAX_WRITE_SIZE
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
extern "C"
|
||||
{
|
||||
|
@ -1955,9 +1959,7 @@ WINHTTPAPI HINTERNET WINAPI WinHttpOpen
|
|||
|
||||
std::vector<std::string> proxies = Split(session->GetProxy(), ';');
|
||||
if (proxies.empty())
|
||||
{
|
||||
proxies.push_back(session->GetProxy());
|
||||
}
|
||||
proxies.push_back(std::string(pszProxyW));
|
||||
session->SetProxies(proxies);
|
||||
}
|
||||
|
||||
|
@ -2444,6 +2446,9 @@ BOOLAPI WinHttpSendRequest
|
|||
CURL_BAILOUT_ONERROR(res, request, FALSE);
|
||||
}
|
||||
|
||||
res = curl_easy_setopt(request->GetCurl(), CURLOPT_BUFFERSIZE, WINHTTP_CURL_MAX_WRITE_SIZE);
|
||||
CURL_BAILOUT_ONERROR(res, request, FALSE);
|
||||
|
||||
request->GetTotalLength() = dwTotalLength;
|
||||
res = curl_easy_setopt(request->GetCurl(), CURLOPT_READDATA, request);
|
||||
CURL_BAILOUT_ONERROR(res, request, FALSE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче