result
_WebDataHandler::StartDownload(const String& url)
{
- SysLog(NID_WEB_CTRL, "Start Download %S", url.GetPointer());
+ SysSecureLog(NID_WEB_CTRL, "The current value of url is %ls", url.GetPointer());
SysTryReturnResult(NID_WEB_CTRL, __pHttpSession.get() == null, E_INVALID_OPERATION, "[%s] Already Downloading is in progress.", GetErrorMessage(E_INVALID_OPERATION));
Uri baseUri;
baseUri.SetUri(url);
- ClearLastResult();
+
+ String domain(baseUri.GetScheme());
+ domain.Append(L"://");
+ domain.Append(baseUri.GetHost());
+ if (baseUri.GetPort() != -1)
+ {
+ domain.Append(L":");
+ domain.Append(Integer(baseUri.GetPort()).ToString());
+ }
std::unique_ptr<HttpSession> pHttpSession(new (std::nothrow) HttpSession());
SysTryReturnResult(NID_WEB_CTRL, pHttpSession.get() , E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
- result r = pHttpSession->Construct(NET_HTTP_SESSION_MODE_NORMAL, null, baseUri.GetHost(), null);
+ result r = pHttpSession->Construct(NET_HTTP_SESSION_MODE_NORMAL, null, domain, null);
SysTryReturn(NID_WEB_CTRL, r == E_SUCCESS, r, r, "[%s] propogating.", GetErrorMessage(r));
r = pHttpSession->SetAutoRedirectionEnabled(true);
void
_WebDataHandler::OnTransactionCertVerificationRequiredN(HttpSession& httpSession, HttpTransaction& httpTransaction, String* pCert)
{
-httpTransaction.Resume();
+ httpTransaction.Resume();
delete pCert;
}