webservices/wscore/src/senxmldao.cpp
branchRCL_3
changeset 37 1adb97a15c2f
parent 36 c5fabff9b552
child 42 9db35237e6aa
--- a/webservices/wscore/src/senxmldao.cpp	Tue Aug 31 16:18:26 2010 +0300
+++ b/webservices/wscore/src/senxmldao.cpp	Wed Sep 01 12:28:05 2010 +0100
@@ -1712,16 +1712,16 @@
         // when server (main thread) goes down.
         
         pLookupInfo = NULL;
-        if(pHostlet->Threadsafe())
+        if(pHostlet && pHostlet->Threadsafe())
             {
-            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Adding new threadsafe, unsharable provider into cache.");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Adding new threadsafe, unsharable provider into cache.");
             pLookupInfo = CSenHostletLookupInfo::NewLC(aReqThreadId, aReqConsumerId);
             }
         else
             {
             // Any non-threadsafe provider should compare whether consumer ID
             // is equal. The thread ID is irrelevant in the matching.
-            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel,"- Adding new non-threadsafe, unsharable provider into cache.");
+            TLSLOG_L(KSenCoreServiceManagerLogChannelBase  , KMinLogLevel,"- Adding new non-threadsafe, unsharable provider into cache.");
             pLookupInfo = CSenHostletLookupInfo::NewLC(KNullDesC, aReqConsumerId);
             }
 
@@ -1729,7 +1729,7 @@
         append = iUnsharableProviders.Append(pLookupInfo, pHostlet);
         if(append==KErrNone)
             {
-            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMaxLogLevel, _L8("- Loaded new unsharable hostlet instance: 0x%X, lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount()));
+            TLSLOG_FORMAT((KSenCoreServiceManagerLogChannelBase  , KMinLogLevel, _L8("- Loaded new unsharable hostlet instance: 0x%X, lookup info: 0x%X, lookup count: %d"), pHostlet, pLookupInfo, pLookupInfo->LookupCount()));
             CleanupStack::Pop(2); // pLookupInfo, pHostlet
             }
         else
@@ -1933,12 +1933,26 @@
 
 TPtrC CSenHostletLookupInfo::ThreadId() const
     {
-    return *ipFullThreadName;
+    if(ipFullThreadName)
+    	{
+    	return *ipFullThreadName;
+    	}
+    else
+    	{
+    	return KNullDesC();
+    	}
     }
 
 TPtrC8 CSenHostletLookupInfo::ConsumerId() const
     {
-    return *ipUniqueConsumerId;
+    if(ipUniqueConsumerId)
+    	{
+    	return *ipUniqueConsumerId;
+    	}
+    else
+    	{
+    	return KNullDesC8();
+    	}	
     }
 
 
@@ -1960,9 +1974,15 @@
 
 TBool CSenHostletLookupInfo::operator==(const CSenHostletLookupInfo& aHostletRequestor)
     {
-    return((ipFullThreadName->Length()==0 || aHostletRequestor.ThreadId() == *ipFullThreadName)
+    if(ipFullThreadName && ipUniqueConsumerId)
+    	{
+    	return((ipFullThreadName->Length()==0 || aHostletRequestor.ThreadId() == *ipFullThreadName)
             && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
-    
+    	}
+    else
+    	{
+    	return EFalse;
+    	}	
     //    return (aHostletRequestor.ThreadId() == *ipFullThreadName
 //            && aHostletRequestor.ConsumerId() == *ipUniqueConsumerId);
     }