datacommsserver/esockserver/ssock/ss_sapshim.cpp
changeset 2 dee179edb159
parent 0 dfb7c4ff071f
child 9 77effd21b2c9
equal deleted inserted replaced
1:21d2ab05f085 2:dee179edb159
   140 	}
   140 	}
   141 
   141 
   142 #endif
   142 #endif
   143 
   143 
   144 CTransportFlowShim::CTransportFlowShim(CSubConnectionFlowFactoryBase& aFactory, const TNodeId& aSubConn, CProtocolIntfBase* aProtocolIntf)
   144 CTransportFlowShim::CTransportFlowShim(CSubConnectionFlowFactoryBase& aFactory, const TNodeId& aSubConn, CProtocolIntfBase* aProtocolIntf)
   145 : CNetworkFlow(aFactory, aSubConn, aProtocolIntf), iFlowParams(TFlowParams(NULL, NULL, KUndefinedProtocol, NULL, NULL))
   145 : CNetworkFlow(aFactory, aSubConn, aProtocolIntf), iFlowParams(TFlowParams(0, 0, 0, 0, NULL))
   146 	{
   146 	{
   147     LOG_NODE_CREATE(KESockFlowTag, CTransportFlowShim)
   147     LOG_NODE_CREATE(KESockFlowTag, CTransportFlowShim)
   148 	}
   148 	}
   149 
   149 
   150 
   150 
   222         protocolReference->LoadAndBindL();
   222         protocolReference->LoadAndBindL();
   223 
   223 
   224         __ASSERT_DEBUG(iProtocolReference == NULL, User::Panic(KSpecAssert_ESockSSocksspshm, 6));
   224         __ASSERT_DEBUG(iProtocolReference == NULL, User::Panic(KSpecAssert_ESockSSocksspshm, 6));
   225         iProtocolReference = protocolReference;
   225         iProtocolReference = protocolReference;
   226 
   226 
       
   227         // If the client requested a wildcard protocol, fill in the actual protocol that was selected
       
   228         if (iFlowParams.iProtocol == KUndefinedProtocol)
       
   229             {
       
   230             iFlowParams.iProtocol = protocolReference->Info().iProtocol;
       
   231             }
       
   232         
   227         // Have the protocol added to the list of protocols for the session it is associated with
   233         // Have the protocol added to the list of protocols for the session it is associated with
   228         CSockSessionProxy* sessionProxy = reinterpret_cast<CSockSessionProxy*>(iFlowParams.iSessionProxy);
   234         CSockSessionProxy* sessionProxy = reinterpret_cast<CSockSessionProxy*>(iFlowParams.iSessionProxy);
   229         if(sessionProxy != NULL)
   235         if(sessionProxy != NULL)
   230             {
   236             {
   231             sessionProxy->AddProtocolL(iProtocolReference->Protocol());
   237             sessionProxy->AddProtocolL(iProtocolReference->Protocol());
   264 void CTransportFlowShim::Unbind()
   270 void CTransportFlowShim::Unbind()
   265     {
   271     {
   266 	LOG( ESockLog::Printf(_L8("CTransportFlowShim %08x:\tUnbind()"), this) );
   272 	LOG( ESockLog::Printf(_L8("CTransportFlowShim %08x:\tUnbind()"), this) );
   267 
   273 
   268 	// Infant mortality case in which binding never completed,
   274 	// Infant mortality case in which binding never completed,
   269 	if(iFlowParams.iProtocol == KUndefinedProtocol)
   275 	if (!FlowParamsInitialised())
   270 		{
   276 		{
   271 		delete this;
   277 		delete this;
   272 		return;
   278 		return;
   273 		}
   279 		}
   274 
   280 
   833 		}
   839 		}
   834 	else
   840 	else
   835 	    {
   841 	    {
   836         __ASSERT_DEBUG(shimFlow, User::Panic(KSpecAssert_ESockSSocksspshm, 35)); //otherwise we shouldn't be here
   842         __ASSERT_DEBUG(shimFlow, User::Panic(KSpecAssert_ESockSSocksspshm, 35)); //otherwise we shouldn't be here
   837        	shimFlow->SetSSP(aSSP);
   843        	shimFlow->SetSSP(aSSP);
   838        	shimFlow->iFlowParams = iFlowParams;
   844        	shimFlow->SetFlowParams(iFlowParams);
   839 	    }
   845 	    }
   840 	return shimFlow;
   846 	return shimFlow;
   841     }
   847     }
   842 
   848 
   843 void CTransportFlowShim::ConnectComplete(CServProviderBase& aSSP)
   849 void CTransportFlowShim::ConnectComplete(CServProviderBase& aSSP)
  1201 	else if (TCFInternalEsock::ERealmId == aMessage.MessageId().Realm())
  1207 	else if (TCFInternalEsock::ERealmId == aMessage.MessageId().Realm())
  1202 		{
  1208 		{
  1203 		switch (aMessage.MessageId().MessageId())
  1209 		switch (aMessage.MessageId().MessageId())
  1204 			{
  1210 			{
  1205 	    case TCFInternalEsock::TFlowProvision::EId :
  1211 	    case TCFInternalEsock::TFlowProvision::EId :
  1206 			iFlowParams = (static_cast<TCFInternalEsock::TFlowProvision&>(aMessage)).iFlowParams;
  1212 			SetFlowParams((static_cast<TCFInternalEsock::TFlowProvision&>(aMessage)).iFlowParams);
  1207 			break;
  1213 			break;
  1208 		default:
  1214 		default:
  1209 			//TODO - logging
  1215 			//TODO - logging
  1210 			//LOG(ESockLog::Printf(KESockMetaConnectionTag, _L("ERROR: CTransportFlowShim %08x:\tReceivedL(%s) - KErrNotSupported"), this, aMessage.Printable()));
  1216 			//LOG(ESockLog::Printf(KESockMetaConnectionTag, _L("ERROR: CTransportFlowShim %08x:\tReceivedL(%s) - KErrNotSupported"), this, aMessage.Printable()));
  1211 			__ASSERT_DEBUG(EFalse, User::Panic(KSpecAssert_ESockSSocksspshm, 45)); //For debug configurations
  1217 			__ASSERT_DEBUG(EFalse, User::Panic(KSpecAssert_ESockSSocksspshm, 45)); //For debug configurations