diff -r c0c2f28ace9c -r a0da872af3fa applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp --- a/applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp Tue Aug 31 15:44:10 2010 +0300 +++ b/applayerpluginsandutils/httpprotocolplugins/httpclient/chttpresponseparser.cpp Wed Sep 01 12:21:21 2010 +0100 @@ -27,6 +27,7 @@ #include "mhttpresponseobserver.h" #include "thttpclientpanic.h" #include "chttpconnectioninfo.h" +#include _LIT8(KHeaderSeparator, "\n"); @@ -295,9 +296,15 @@ } else - { - // Need to map to appropriate error code if the disconnect notification is - // asked by the client + { + // Check client has asked to return Default Error occured while Disconnect received + if (clientTrans->PropogateDefaultError()) + { + NotifyObserverError(aError); + return; + } + // Need to map to appropriate error code if the disconnect notification is + // asked by the client if ( clientTrans->NeedDisconnectNotification() ) { CHttpRequestComposer& request = static_cast(iProtTrans->TxData()); @@ -498,6 +505,40 @@ } } + if (name.DesC().CompareF(stringPool.StringF(HTTP::EWWWAuthenticate,RHTTPSession::GetTable()).DesC()) == KErrNone) + { + _LIT8(KNtlmProtocolName,"NTLM"); + if (aFieldValue.FindF(KNtlmProtocolName)!= KErrNotFound) + { + CHttpClientTransaction& protTran = static_cast(*iProtTrans); + CHttpConnectionManager* manager = protTran.ConnectionManager(); + _LIT8( KNtlmConnId, "NTLMConnId" ); + if (aFieldValue.Length() >= 4 ) + { + if (manager->GetNtlmConnId() == KErrNotFound) + { + TInt ntmlConnId= Math::Random()%5789; //some magic number to get random connection id + manager->SetNtlmConnId(ntmlConnId); + RStringF ntlmId= stringPool.OpenFStringL( KNtlmConnId ); + CleanupClosePushL(ntlmId); + THTTPHdrVal value; + value.SetInt( ntmlConnId ); + trans.PropertySet().SetPropertyL( ntlmId, value ); + CleanupStack::PopAndDestroy(&ntlmId); + } + else + { + RStringF ntlmId= stringPool.OpenFStringL( KNtlmConnId ); + CleanupClosePushL(ntlmId); + THTTPHdrVal value; + value.SetInt(manager->GetNtlmConnId()); + trans.PropertySet().SetPropertyL( ntlmId, value ); + CleanupStack::PopAndDestroy(&ntlmId); + } + } + } + } + CleanupStack::PopAndDestroy(&name); if( BodyComplete() && !GotTrailers() ) @@ -659,7 +700,6 @@ if( !ConsumingResponse() ) { iResponseObserver.ResponseComplete(aExcessData); - if ( iCancellingResponse ) { return; @@ -768,9 +808,11 @@ TBool CHttpResponseParser::NeedCompletion () { RHTTPTransaction trans = iProtTrans->Transaction (); - if ( HTTPStatus::IsRedirection ( trans.Response().StatusCode() ) ) + TInt statusCode = trans.Response().StatusCode(); + if ( HTTPStatus::IsRedirection ( statusCode )|| statusCode == HTTPStatus::EUnauthorized ) { // If it is a redirection message then we need to complete the response + // for 401 error..we have to continue on the same port..so we need to complete the response immediately return ETrue; } return EFalse;