Skip to content

Commit

Permalink
Get authentication credentials before the first WEBDAV transaction.
Browse files Browse the repository at this point in the history
Mulberry handles the 401 authentication failure response and gets
credentials when necessary, but this doesn't work right with some
WEBDAV servers.  As a work around get credentials before the first
transaction.
  • Loading branch information
mtalexander committed Mar 1, 2012
1 parent 7728013 commit 3020244
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Sources_Common/Preferences_Store/Clients/CWebDAVPrefsClient.cpp
Expand Up @@ -164,6 +164,20 @@ void CWebDAVPrefsClient::Reset()

void CWebDAVPrefsClient::Logon()
{
// Get authorization info, some servers require it before the first request
if (!HasAuthorization() &&
GetAccount()->GetAuthenticatorType() != CAuthenticator::eNone)
{
cdstrvect hdrs;
SetHost(mServerAddr);
OpenConnection();
mAuthorization = GetAuthorization(true, hdrs);
if (mAuthorization == (CHTTPAuthorization*) -1)
{
mAuthorization = NULL;
}
}

// Do initialisation if not already done
if (!Initialise(mServerAddr, mBaseRURL))
{
Expand Down

0 comments on commit 3020244

Please sign in to comment.