diff -r abbed5a4b42a -r 8d540f55e491 networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp --- a/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp Tue Aug 31 16:45:15 2010 +0300 +++ b/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp Wed Sep 01 12:33:58 2010 +0100 @@ -38,6 +38,8 @@ #include #include #include +#include +#include "ItfInfoConfigExt.h" using namespace Messages; using namespace MeshMachine; @@ -153,8 +155,10 @@ if (iContext.Node().iTimerStopped) { TInt selfidx = iContext.iNodeActivity->FindOriginator(iContext.Node().SelfInterface()); - ASSERT(selfidx != KErrNotFound); - iContext.iNodeActivity->RemoveOriginator(selfidx); + if(selfidx != KErrNotFound) + { + iContext.iNodeActivity->RemoveOriginator(selfidx); + } } TInt stopCode = KErrCancel; @@ -283,6 +287,19 @@ if (state.Accept()) { iContext.Node().DisableTimers(); + // Check if we have been re-started (i.e. a start request is processed immmediately after a stop request + // has been processed). If so, we generate a special EInterfaceStarting notification towards ESock. + // This is to solve the problem where there is a missing EInterfaceDown/EInterfaceUp event sequence + // from AllInterfaceNotification in this scenario. + if (iContext.Node().iStopped) + { + const TItfInfoConfigExt* ext = static_cast(iContext.Node().AccessPointConfig().FindExtension(STypeId::CreateSTypeId(KIpProtoConfigExtUid, EItfInfoConfigExt))); + if (ext) + { + TInterfaceNotification info = { ext->iConnectionInfo, TConnInterfaceState(EInterfaceRestarting) }; + iContext.Node().Factory().InterfaceStateChange(TPckgC(info)); + } + } return ETrue; } return EFalse; @@ -379,6 +396,7 @@ iContext.Node().SetTimerMode(CIPProtoConnectionProvider::ETimerMedium); iContext.Node().iTimerStopped = EFalse; + iContext.Node().iTimerExpired = EFalse; CoreNetStates::TSendStarted transition(iContext); transition.DoL(); } @@ -409,14 +427,21 @@ TCFMessage::TSubConnDataTransferred wholeConnMsg(KNifEMCompatibilityLayerEntireSubConnectionUid, dmProvider->DataVolumesPtr()->iSentBytes, dmProvider->DataVolumesPtr()->iReceivedBytes); TCFMessage::TSubConnDataTransferred defaultSubConnMsg(KNifEMCompatibilityLayerFakeSubConnectionId, dmProvider->DataVolumesPtr()->iSentBytes, dmProvider->DataVolumesPtr()->iReceivedBytes); - RNodeInterface* ctrlClient = iContext.Node().GetFirstClient(TClientType(TCFClientType::ECtrl)); - if(ctrlClient) - { // Can't send this if the client's gone - ctrlClient->PostMessage(iContext.NodeId(), wholeConnMsg); - ctrlClient->PostMessage(iContext.NodeId(), defaultSubConnMsg); - - iContext.Node().iSubConnEventDataSent = ETrue; - } + // Sending data clent status change message to all the control clients + TClientIter ccIter = iContext.Node().GetClientIter(TClientType(TCFClientType::ECtrl), TClientType(0, TCFClientType::ELeaving)); + RNodeInterface* ctrlClient; + TBool ctrlClientPresent = false; + while ((ctrlClient = ccIter++) != NULL) + { + //If any cntl clinet is present setting the variable ctrlClientPresent as true. + ctrlClientPresent = true; + ctrlClient->PostMessage(iContext.NodeId(), wholeConnMsg); + ctrlClient->PostMessage(iContext.NodeId(), defaultSubConnMsg); + } + if(ctrlClientPresent) + { + iContext.Node().iSubConnEventDataSent = ETrue; + } } }