networksecurity/tls/protocol/tlsconnection.cpp
changeset 68 1697cc2ba93d
parent 61 2fc972553898
equal deleted inserted replaced
62:2f37ef12b43e 68:1697cc2ba93d
    51   	LOG(Log::Printf(_L("RHeap::Size(), RHeap::Size() - RHeap::Available() %d, %d"), User::Heap().Size(), User::Heap().Size() - User::Heap().Available( nBlock ) );)
    51   	LOG(Log::Printf(_L("RHeap::Size(), RHeap::Size() - RHeap::Available() %d, %d"), User::Heap().Size(), User::Heap().Size() - User::Heap().Available( nBlock ) );)
    52 #endif
    52 #endif
    53 
    53 
    54 	CleanupStack::PushL(self);
    54 	CleanupStack::PushL(self);
    55 	self->ConstructL(aSocket, aProtocol);
    55 	self->ConstructL(aSocket, aProtocol);
    56 	CleanupStack::Pop();
    56 	CleanupStack::Pop(self);
    57 	return self;
    57 	return self;
    58 }
    58 }
    59 
    59 
    60 EXPORT_C MSecureSocket* CTlsConnection::NewL(MGenericSecureSocket& aSocket, const TDesC& aProtocol)
    60 EXPORT_C MSecureSocket* CTlsConnection::NewL(MGenericSecureSocket& aSocket, const TDesC& aProtocol)
    61 /**
    61 /**
    76   	LOG(Log::Printf(_L("RHeap::Size(), RHeap::Size() - RHeap::Available() %d, %d"), User::Heap().Size(), User::Heap().Size() - User::Heap().Available( nBlock ) );)
    76   	LOG(Log::Printf(_L("RHeap::Size(), RHeap::Size() - RHeap::Available() %d, %d"), User::Heap().Size(), User::Heap().Size() - User::Heap().Available( nBlock ) );)
    77 #endif
    77 #endif
    78 
    78 
    79 	CleanupStack::PushL(self);
    79 	CleanupStack::PushL(self);
    80 	self->ConstructL(aSocket, aProtocol);
    80 	self->ConstructL(aSocket, aProtocol);
    81 	CleanupStack::Pop();
    81 	CleanupStack::Pop(self);
    82 	return self;
    82 	return self;
    83 }
    83 }
    84 
    84 
    85 EXPORT_C void CTlsConnection::UnloadDll(TAny* /*aPtr*/)
    85 EXPORT_C void CTlsConnection::UnloadDll(TAny* /*aPtr*/)
    86 /**
    86 /**
  1188 	   if ( iHandshake != aStateMachine )
  1188 	   if ( iHandshake != aStateMachine )
  1189 	      {
  1189 	      {
  1190 		   return EFalse;
  1190 		   return EFalse;
  1191 	      }
  1191 	      }
  1192       else
  1192       else
  1193          {//delete data path in case it's re-negotiation what's failed
  1193          {
  1194          delete iSendAppData;
  1194           if (aStateMachine->LastError() != KErrEof)
  1195          iSendAppData = NULL;
  1195                 {
  1196          delete iRecvAppData;
  1196                 }
  1197          iRecvAppData = NULL;
  1197             else
  1198          ResetCryptoAttributes();
  1198                 {
       
  1199                 delete iSendAppData;
       
  1200                 iSendAppData = NULL;
       
  1201                 delete iRecvAppData;
       
  1202                 iRecvAppData = NULL;
       
  1203                 ResetCryptoAttributes();
       
  1204                 }
  1199          }
  1205          }
  1200    }
  1206    }
  1201    else
  1207    else
  1202    {//from now on we propose the alrady negotiated protocol untill the connection is closed
  1208    {//from now on we propose the alrady negotiated protocol untill the connection is closed
  1203       iTlsProvider->Attributes()->iProposedProtocol = iTlsProvider->Attributes()->iNegotiatedProtocol;
  1209       iTlsProvider->Attributes()->iProposedProtocol = iTlsProvider->Attributes()->iNegotiatedProtocol;