Permalink
Browse files

Get authentication credentials before the first WEBDAV transaction.

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 302024465479bed568cf304b71e7cff41b0c0a57
Showing with 14 additions and 0 deletions.
  1. +14 −0 Sources_Common/Preferences_Store/Clients/CWebDAVPrefsClient.cpp
@@ -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))
{

0 comments on commit 3020244

Please sign in to comment.