# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1277130318 -10800 # Node ID d566d76acea1cb16feae948fc3210c3d80641c19 # Parent 4214adf9e0d37c538906db3c0a5b0ced4afc6a15 Revision: 201025 Kit: 2010125 diff -r 4214adf9e0d3 -r d566d76acea1 linklayercontrol/networkinterfacemgr/netcfgext/inc/netcfgextnotify.h --- a/linklayercontrol/networkinterfacemgr/netcfgext/inc/netcfgextnotify.h Wed Jun 09 11:23:04 2010 +0300 +++ b/linklayercontrol/networkinterfacemgr/netcfgext/inc/netcfgextnotify.h Mon Jun 21 17:25:18 2010 +0300 @@ -38,6 +38,7 @@ MNifIfNotify interface Only IfProgress, DoReadDes and DoReadInt supported. */ + ~CNetCfgExtNotify(); void LinkLayerDown(TInt aReason, TAction aAction); void LinkLayerUp(); void NegotiationFailed(CNifIfBase* aIf, TInt aReason); diff -r 4214adf9e0d3 -r d566d76acea1 linklayercontrol/networkinterfacemgr/netcfgext/src/netcfgextnotify.cpp --- a/linklayercontrol/networkinterfacemgr/netcfgext/src/netcfgextnotify.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/linklayercontrol/networkinterfacemgr/netcfgext/src/netcfgextnotify.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -35,11 +35,19 @@ { } +CNetCfgExtNotify::~CNetCfgExtNotify() + { + iScpr = NULL; + } + void CNetCfgExtNotify::IfProgress(TInt aStage, TInt aError) { TStateChange change(aStage, aError); + if(iScpr) + { RClientInterface::OpenPostMessageClose(iScpr->Id(), iScpr->Id(), TCFMessage::TStateChange(change).CRef()); + } } TInt CNetCfgExtNotify::DoReadInt(const TDesC& aField, TUint32& aValue,const RMessagePtr2* /*aMessage*/) diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/commsuserpromptmgr/state/src/netupsstatemachine.cpp --- a/networkcontrol/commsuserpromptmgr/state/src/netupsstatemachine.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/commsuserpromptmgr/state/src/netupsstatemachine.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -71,27 +71,71 @@ // Note the order in which the states are instantiated must match the // order in which they are defined in the enumeration TNetUpsState - or a panic will occur. - iState.Append(CState::NewL(ENull, *this)); + CState* state=CState::NewL(ENull, *this); + + CleanupStack::PushL(state); + iState.AppendL(state); + CleanupStack::Pop(state); + switch(iNetUpsImpl.LifeTimeMode()) { + case CNetUpsImpl::EProcessLifeTimeMode: { - iState.Append(CState::NewL(EProcLife_NonSession, *this)); - iState.Append(CState::NewL(EProcLife_Transit_SessionYes, *this)); // a transient state is entered when the UPS Server responds with either SessionYes or SessionNo and there are 1 or more UPS requests outstanding to other subsessions which are associated with the same process. - iState.Append(CState::NewL(EProcLife_SessionYes, *this)); - iState.Append(CState::NewL(EProcLife_Transit_SessionNo, *this)); - iState.Append(CState::NewL(EProcLife_SessionNo, *this)); + CState* stateone= CState::NewL(EProcLife_NonSession, *this); + CleanupStack::PushL(stateone); + iState.AppendL(stateone); + + CState* statetwo = CState::NewL(EProcLife_Transit_SessionYes, *this); + CleanupStack::PushL(statetwo); + iState.AppendL(statetwo); // a transient state is entered when the UPS Server responds with either SessionYes or SessionNo and there are 1 or more UPS requests outstanding to other subsessions which are associated with the same process. + + CState* statethree = CState::NewL(EProcLife_SessionYes, *this); + CleanupStack::PushL(statethree); + iState.AppendL(statethree); + + CState* statefour = CState::NewL(EProcLife_Transit_SessionNo, *this); + CleanupStack::PushL(statefour); + iState.AppendL(statefour); + + CState* statefive = CState::NewL(EProcLife_SessionNo, *this); + CleanupStack::PushL(statefive); + iState.AppendL(statefive); + + CleanupStack::Pop(5); break; } case CNetUpsImpl::ENetworkLifeTimeMode: { - iState.Append(CState::NewL(ENetLife_NonSession, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_Transit_WithoutConnections, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_WithOutConnections, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_Transit_WithConnections, *this)); - iState.Append(CState::NewL(ENetLife_SessionNo_WithConnections, *this)); - iState.Append(CState::NewL(ENetLife_Transit_SessionYes, *this)); - iState.Append(CState::NewL(ENetLife_SessionYes, *this)); + CState* stateone = CState::NewL(EProcLife_NonSession, *this); + CleanupStack::PushL(stateone); + iState.AppendL(stateone); + + CState* statetwo = CState::NewL(ENetLife_SessionNo_Transit_WithoutConnections, *this); + CleanupStack::PushL(statetwo); + iState.AppendL(statetwo); + + CState* statethree = CState::NewL(ENetLife_SessionNo_WithOutConnections, *this); + CleanupStack::PushL(statethree); + iState.AppendL(statethree); + + CState* statefour = CState::NewL(ENetLife_SessionNo_Transit_WithConnections, *this); + CleanupStack::PushL(statefour); + iState.AppendL(statefour); + + CState* statefive = CState::NewL(ENetLife_SessionNo_WithConnections, *this); + CleanupStack::PushL(statefive); + iState.AppendL(statefive); + + CState* statesix = CState::NewL(ENetLife_Transit_SessionYes, *this); + CleanupStack::PushL(statesix); + iState.AppendL(statesix); + + CState* stateseven = CState::NewL(ENetLife_SessionYes, *this); + CleanupStack::PushL(stateseven); + iState.AppendL(stateseven); + + CleanupStack::Pop(7); break; } default: diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/ipnetworklayer/addressinfohook/src/hookaddrinfo.cpp --- a/networkcontrol/ipnetworklayer/addressinfohook/src/hookaddrinfo.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/ipnetworklayer/addressinfohook/src/hookaddrinfo.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -38,8 +38,10 @@ EXPORT_C void CHookAddressInfo::AddL(CIPProtoBinder* aBinder, CSubConIPAddressInfoParamSet::TSubConIPAddressInfo& aAddrInfo) { TIpAddrBinder *addrBinder = new(ELeave) TIpAddrBinder(aBinder, aAddrInfo); - - iAddrInfo.Append(addrBinder); + + CleanupStack::PushL(addrBinder); + iAddrInfo.AppendL(addrBinder); + CleanupStack::Pop(addrBinder); //Try match the address info to existing flows TDblQueIter iter(*iFlows); diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/ipnetworklayer/inc/IPProtoCPR.h --- a/networkcontrol/ipnetworklayer/inc/IPProtoCPR.h Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/ipnetworklayer/inc/IPProtoCPR.h Mon Jun 21 17:25:18 2010 +0300 @@ -194,6 +194,7 @@ TBool iLinkUp:1; TBool iConnectionControlActivity:1; TBool iTimerExpired:1; + TBool iTimerStopped:1; TBool iTimerRunning:1; TBool iSubConnEventDataSent:1; // Hack to cope with multiple DataClientStatusChange notifications for 'stopped' TBool iNodeLocalExtensionsCreated; diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/ipnetworklayer/inc/ipprotodeftscpr.h --- a/networkcontrol/ipnetworklayer/inc/ipprotodeftscpr.h Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/ipnetworklayer/inc/ipprotodeftscpr.h Mon Jun 21 17:25:18 2010 +0300 @@ -103,6 +103,8 @@ CNifConfigurationControl* iControl; Messages::RNodeInterface iFlow; TBool iIoctlCancelled; +public: + TBool iNetworkConfigurationState; }; #endif //SYMBIAN_IPPROTODEFTSCPR_H diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/ipnetworklayer/src/IPProtoCPR.cpp --- a/networkcontrol/ipnetworklayer/src/IPProtoCPR.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/ipnetworklayer/src/IPProtoCPR.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -757,6 +757,7 @@ if (!iTimerExpired) { iTimerExpired = ETrue; + iTimerStopped = ETrue; CancelTimer(); if (CountActivities(ECFActivityStop) == 0 && CountActivities(ECFActivityDestroy) == 0) { diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp --- a/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/ipnetworklayer/src/IPProtoCprStates.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -150,7 +150,7 @@ // stop has been caused by timer expiry, remove self from originators list, because we // are not waiting for TStopped and in certain situations it would arrive after the node has been // destroyed - if (iContext.Node().iTimerExpired) + if (iContext.Node().iTimerStopped) { TInt selfidx = iContext.iNodeActivity->FindOriginator(iContext.Node().SelfInterface()); ASSERT(selfidx != KErrNotFound); @@ -378,6 +378,7 @@ iContext.Node().SetUsageProfile(KConnProfileMedium); iContext.Node().SetTimerMode(CIPProtoConnectionProvider::ETimerMedium); + iContext.Node().iTimerStopped = EFalse; CoreNetStates::TSendStarted transition(iContext); transition.DoL(); } diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp --- a/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/ipnetworklayer/src/ipprotodeftscpr.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -164,7 +164,8 @@ ALegacySubConnectionActiveApiExt(this), TIfStaticFetcherNearestInHierarchy(this), iNotify(NULL), - iControl(NULL) + iControl(NULL), + iNetworkConfigurationState(EFalse) { LOG_NODE_CREATE(KIPProtoDeftScprTag, CIPProtoDeftSubConnectionProvider); } @@ -195,10 +196,25 @@ CIPProtoDeftSubConnectionProvider::~CIPProtoDeftSubConnectionProvider() { + // In case network is not configured i.e. AP might get close in case for WIFi for an example, DHCP registration + //will get failed. There is not point listening to such Progresses. So can notification and delete + //delete CNetCfgExtNotify pointer). + if(iNetworkConfigurationState == EFalse) + { + if(iNotify) + { + delete iNotify; + iNotify = NULL; + } + } if (iControl) delete iControl; + //incase registration is successful and Network is configured. if (iNotify) + { delete iNotify; + iNotify = NULL; + } LOG_NODE_DESTROY(KIPProtoDeftScprTag, CIPProtoDeftSubConnectionProvider); } diff -r 4214adf9e0d3 -r d566d76acea1 networkcontrol/ipnetworklayer/src/ipprotodeftscprstates.cpp --- a/networkcontrol/ipnetworklayer/src/ipprotodeftscprstates.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networkcontrol/ipnetworklayer/src/ipprotodeftscprstates.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -162,6 +162,7 @@ if (msg.iStateChange.iStage == KLinkLayerOpen) { + iContext.Node().iNetworkConfigurationState = ETrue; return KNetworkConfigured; } @@ -171,7 +172,11 @@ DEFINE_SMELEMENT(TNetworkConfiguredOrErrorTagOrCancelTagOrNoTagBackward, NetStateMachine::MStateFork, IPProtoDeftSCpr::TContext) TInt IPProtoDeftSCpr::TNetworkConfiguredOrErrorTagOrCancelTagOrNoTagBackward::TransitionTag() { + iContext.Node().iNetworkConfigurationState = EFalse; TInt tag = IPProtoDeftSCpr::TNetworkConfiguredOrErrorTagOrCancelTagOrNoTag::TransitionTag(); + + + if (tag == KNoTag) return tag | NetStateMachine::EBackward; return tag; diff -r 4214adf9e0d3 -r d566d76acea1 networkprotocols/tcpipv4v6prt/inc/tcp.h --- a/networkprotocols/tcpipv4v6prt/inc/tcp.h Wed Jun 09 11:23:04 2010 +0300 +++ b/networkprotocols/tcpipv4v6prt/inc/tcp.h Mon Jun 21 17:25:18 2010 +0300 @@ -620,7 +620,7 @@ void ProcessSegments(); void SendSegments(TBool aNagleOverride = EFalse); void RetransmitTimeout(); - void RetransmitSegments(); + TBool RetransmitSegments(); void ClearSYNSettings(); /** diff -r 4214adf9e0d3 -r d566d76acea1 networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp --- a/networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networkprotocols/tcpipv4v6prt/src/tcp_sap.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -1684,7 +1684,8 @@ if (iFlags.iRetransmitPending) { iFlags.iRetransmitPending = EFalse; - RetransmitSegments(); + if(RetransmitSegments()) + return; } if (iFlags.iTransmitPending) @@ -2288,7 +2289,12 @@ ++iBackoff; if (iRTO < Protocol()->MaxRTO()) // Avoid RTO overflow ResetRTO(); - + + if(DetachIfDead()) + { + Expire(); + return; + } // // Timeout? // @@ -2403,7 +2409,7 @@ // - directly from RetransmitTimeout() // - from CanSend(), in which case this is a delayed retransmission timeout // -void CProviderTCP6::RetransmitSegments() +TBool CProviderTCP6::RetransmitSegments() { ASSERT(iRetransTimer); @@ -2419,7 +2425,7 @@ { LOG(Log::Printf(_L("\ttcp SAP[%u] RetransmitSegments(): Flow pending"), (TInt)this)); ReSchedRetransmit(); - return; + return EFalse; } // @@ -2477,14 +2483,14 @@ // the receiver suddenly shrinks its window. The current solution covers // both cases. // - return; + return EFalse; } // // This is a retransmit timout. Do we have anything to do? // if (!unacked) - return; + return EFalse; LOG(if (iFlags.iFastRetransMode) Log::Printf(_L("\ttcp SAP[%u] RetransmitSegments(): Leaving FAST RETRANS mode"), (TInt)this)); iFlags.iFastRetransMode = EFalse; @@ -2557,7 +2563,7 @@ // If the server doesn't respond because of broken NAT/FW or other, don't keep interface up. if (InState(ETcpFinWait1|ETcpClosing|ETcpLastAck)) DetachIfDead(); - return; + return EFalse; } // @@ -2567,14 +2573,14 @@ { // Retransmit SYN SendSegment(KTcpCtlSYN, iSND.UNA); - return; + return EFalse; } if (InState(ETcpSynReceived)) { // Retransmit SYN,ACK SendSegment(KTcpCtlSYN|KTcpCtlACK, iSND.UNA); - return; + return EFalse; } if (InState(ETcpFinWait1|ETcpClosing|ETcpLastAck)) @@ -2584,18 +2590,22 @@ //TSW error:JHAA-82JBNG -- FIN retransmission //Depending on the function return value the decision to //retransmitt FIN is decided - - TBool continue_send = DetachIfDead(); + // Retransmit FIN - if(continue_send == EFalse) + if(DetachIfDead()== EFalse) + { SendSegment(KTcpCtlFIN|KTcpCtlACK, iSND.UNA); - return; + return EFalse; + } } LOG(Log::Printf(_L("\ttcp SAP[%u] RetransmitSegments(): Retransmitter stopping"), (TInt)this)); if (!iSockFlags.iAttached) + { Expire(); - return; + return ETrue; + } + return EFalse; } diff -r 4214adf9e0d3 -r d566d76acea1 networksecurity/ipsec/ipsecpol/src/ipsecpolmanhandler.cpp --- a/networksecurity/ipsec/ipsecpol/src/ipsecpolmanhandler.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networksecurity/ipsec/ipsecpol/src/ipsecpolmanhandler.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -1450,7 +1450,9 @@ if (autoloadListItem != NULL) { - iScopedAutoloadPolicyPairs.Append(autoloadListItem); + CleanupStack::PushL(autoloadListItem); + iScopedAutoloadPolicyPairs.AppendL(autoloadListItem); + CleanupStack::Pop(autoloadListItem); } } diff -r 4214adf9e0d3 -r d566d76acea1 networksecurity/ipsec/ipsecpol/src/ipsecpolmanutil.cpp --- a/networksecurity/ipsec/ipsecpol/src/ipsecpolmanutil.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/networksecurity/ipsec/ipsecpol/src/ipsecpolmanutil.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -73,7 +73,7 @@ if (j==count) { TInt position = 0; - gatewayList.Insert( &itemL->iTunnel, position); + gatewayList.InsertL( &itemL->iTunnel, position); // Build two strings for policy file stringBuf.Zero(); diff -r 4214adf9e0d3 -r d566d76acea1 tcpiputils/dhcp/src/DHCPStateMachine.cpp --- a/tcpiputils/dhcp/src/DHCPStateMachine.cpp Wed Jun 09 11:23:04 2010 +0300 +++ b/tcpiputils/dhcp/src/DHCPStateMachine.cpp Mon Jun 21 17:25:18 2010 +0300 @@ -441,7 +441,7 @@ } else { - __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress,Socket Open Failed: Due to KErrNotReady "))); + __CFLOG_VAR((KLogSubSysDHCP, KLogCode, _L("CDHCPStateMachine::RemoveConfiguredAddress,Socket Open Failed: Due to %d"),error)); } }