Index: src/DefaultWebRequestWinInet.cpp |
=================================================================== |
--- a/src/DefaultWebRequestWinInet.cpp |
+++ b/src/DefaultWebRequestWinInet.cpp |
@@ -152,18 +152,18 @@ void ParseResponseHeaders(HINTERNET hReq |
continue; |
} |
std::wstring headerNameW = responseHeaders.substr(prevHeaderStart, headerNameEnd - prevHeaderStart); |
std::wstring headerValueW = responseHeaders.substr(headerValueStart, nextHeaderNameStart - headerValueStart); |
headerNameW = AdblockPlus::Utils::TrimString(headerNameW); |
headerValueW = AdblockPlus::Utils::TrimString(headerValueW); |
- std::string headerName = AdblockPlus::Utils::ToUTF8String(headerNameW.c_str(), headerNameW.length()); |
- std::string headerValue = AdblockPlus::Utils::ToUTF8String(headerValueW.c_str(), headerValueW.length()); |
+ std::string headerName = AdblockPlus::Utils::ToUTF8String(headerNameW.c_str()); |
+ std::string headerValue = AdblockPlus::Utils::ToUTF8String(headerValueW.c_str()); |
std::transform(headerName.begin(), headerName.end(), headerName.begin(), ::tolower); |
std::transform(headerValue.begin(), headerValue.end(), headerValue.begin(), ::tolower); |
result->responseHeaders.push_back( |
std::pair<std::string, std::string>(headerName, headerValue)); |
nextHeaderNameStart++; |
@@ -191,25 +191,25 @@ AdblockPlus::ServerResponse AdblockPlus: |
{ |
AdblockPlus::ServerResponse result; |
result.status = NS_ERROR_FAILURE; |
result.responseStatus = 0; |
HRESULT hr; |
BOOL res; |
- std::wstring canonizedUrl = Utils::CanonizeUrl(Utils::ToUTF16String(url, url.length())); |
+ std::wstring canonizedUrl = Utils::CanonizeUrl(Utils::ToUTF16String(url)); |
std::string headersString = ""; |
for (int i = 0; i < requestHeaders.size(); i++) |
{ |
headersString += requestHeaders[i].first + ": "; |
headersString += requestHeaders[i].second + ";"; |
} |
- std::wstring headers = Utils::ToUTF16String(headersString, headersString.length()); |
+ std::wstring headers = Utils::ToUTF16String(headersString); |
LPSTR outBuffer; |
DWORD downloadSize, downloaded; |
WinHttpHandle hSession(0), hConnect(0), hRequest(0); |
// Use WinHttpOpen to obtain a session handle. |
std::wstring proxyName, proxyBypass; |