Catchup to latest Symbian^4 GCC_SURGE
authorWilliam Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:30:29 +0100
branchGCC_SURGE
changeset 25 b3527b504290
parent 19 524d3c380bba (current diff)
parent 24 fb066cc7cee3 (diff)
Catchup to latest Symbian^4
--- a/nettools/conntest/Engine/HttpHandler.cpp	Fri Jun 11 16:23:30 2010 +0100
+++ b/nettools/conntest/Engine/HttpHandler.cpp	Thu Jul 22 16:30:29 2010 +0100
@@ -142,6 +142,7 @@
     TBuf<100> proxyAddr;
     TBuf8<100> proxyAddr2;
     TUint32 proxyPort;
+    TBool useProxy;
     TUint connCount;
     CCommsDatabase* TheDb;
     RStringF proxyName;
@@ -191,24 +192,29 @@
         
         if(result == KErrNone)
         {
-            // This IAP uses proxy, set it to http session
-            view->ReadUintL(TPtrC(PROXY_PORT_NUMBER), proxyPort);
-            HBufC* k = view->ReadLongTextLC(TPtrC(PROXY_SERVER_NAME));
-            proxyAddr.Copy(k->Des());
-            proxyAddr.AppendFormat(_L(":%d"), proxyPort);
-            
-            proxyAddr2.Copy(proxyAddr);
-            
-            CleanupClosePushL(proxyName);
-            proxyName = iHttpSession.StringPool().OpenFStringL(proxyAddr2);
-            connInfo.SetPropertyL( strPool.StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), 
-                                   proxyUsage );
-            connInfo.SetPropertyL( strPool.StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), 
-                                   proxyName );
-            CleanupStack::PopAndDestroy(&proxyName); // proxyName
-            CleanupStack::PopAndDestroy(k); //k
-            
-            RDebug::Print(_L("ConnTest: Proxy address: %S"), &proxyAddr);
+            // Check whether proxy should be used for this IAP
+            TRAPD(proxyErr, view->ReadBoolL(TPtrC(PROXY_USE_PROXY_SERVER), useProxy));
+            if((proxyErr == KErrNone) && useProxy)
+            {
+                // This IAP uses proxy, set it to http session
+                view->ReadUintL(TPtrC(PROXY_PORT_NUMBER), proxyPort);
+                HBufC* k = view->ReadLongTextLC(TPtrC(PROXY_SERVER_NAME));
+                proxyAddr.Copy(k->Des());
+                proxyAddr.AppendFormat(_L(":%d"), proxyPort);
+                
+                proxyAddr2.Copy(proxyAddr);
+                
+                CleanupClosePushL(proxyName);
+                proxyName = iHttpSession.StringPool().OpenFStringL(proxyAddr2);
+                connInfo.SetPropertyL( strPool.StringF(HTTP::EProxyUsage,RHTTPSession::GetTable()), 
+                                       proxyUsage );
+                connInfo.SetPropertyL( strPool.StringF(HTTP::EProxyAddress,RHTTPSession::GetTable()), 
+                                       proxyName );
+                CleanupStack::PopAndDestroy(&proxyName); // proxyName
+                CleanupStack::PopAndDestroy(k); //k
+                
+                RDebug::Print(_L("ConnTest: Proxy address: %S"), &proxyAddr);
+            }
         }
         CleanupStack::PopAndDestroy(view); // view
         CleanupStack::PopAndDestroy(TheDb); // TheDb
--- a/nettools/conntest/data/ConnTest_reg.rss	Fri Jun 11 16:23:30 2010 +0100
+++ b/nettools/conntest/data/ConnTest_reg.rss	Thu Jul 22 16:30:29 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). 
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -16,7 +16,7 @@
 */
 
 #include <appinfo.rh>
-#include <ConnTest.rsg>
+#include <conntest.rsg>
 
 UID2 KUidAppRegistrationResourceFile
 UID3 0x101F6D2B // application UID
--- a/nettools/conntest/probe/src/prt.cpp	Fri Jun 11 16:23:30 2010 +0100
+++ b/nettools/conntest/probe/src/prt.cpp	Thu Jul 22 16:30:29 2010 +0100
@@ -307,18 +307,20 @@
 
 		const TInt KMicrosInASecond = 1000000;
 
-		//TUint32 micros = interval.Int64().Low();
-		TUint32 micros = I64LOW(interval.Int64());//.Low();  x.Low() -> I64LOW(x)
-		TUint32 secs = micros / KMicrosInASecond;
-		micros -= (secs * KMicrosInASecond);
+		// To avoid possible overflow caused by microsecond accuracy (32 bits
+		// of microseconds is just a bit over an hour), use 64-bit variables
+		// in calculation of timestamp
+		TInt64 secs = interval.Int64() / KMicrosInASecond;
 
 		//
 		// Reuse the protocol and flags fields of
 		// RMBufPktInfo to store the time-stamp
 		//
 		RMBufPktInfo* info = RMBufPacket::PeekInfoInChain(copy);
-		info->iProtocol = static_cast<TInt>(secs);
-		info->iFlags = static_cast<TUint>(micros);
+		// Just let the seconds overflow in case of timestamp is over the
+		// integer scope (nothing reasonable to do in this case anyway)
+		info->iProtocol = static_cast<TInt>( secs );
+		info->iFlags = static_cast<TUint>( interval.Int64() - ( secs * KMicrosInASecond ));
 
 		iQueue.Append(copy);
 		iDumpCb.CallBack();
--- a/nettools/conntest/src/ConnTestAppUi.cpp	Fri Jun 11 16:23:30 2010 +0100
+++ b/nettools/conntest/src/ConnTestAppUi.cpp	Thu Jul 22 16:30:29 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+ * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -26,7 +26,7 @@
 
 #include "ConnTestAppUi.h"
 #include "ConnTestView.h"
-#include <ConnTest.rsg>
+#include <conntest.rsg>
 #include "conntest.hrh"
 #include "SettingData.h"
 #include "ipdumpengine.h"
--- a/nettools/conntest/src/ConnTestView.cpp	Fri Jun 11 16:23:30 2010 +0100
+++ b/nettools/conntest/src/ConnTestView.cpp	Thu Jul 22 16:30:29 2010 +0100
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+ * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -22,7 +22,7 @@
 #include <avkon.hrh>
 #include <AknGlobalNote.h>
 
-#include <ConnTest.rsg>
+#include <conntest.rsg>
 #include "ConnTestView.h"
 #include "ConnTestContainer.h"
 #include "CustomPrefsItemList.h"
--- a/nettools/conntest/src/Utils.cpp	Fri Jun 11 16:23:30 2010 +0100
+++ b/nettools/conntest/src/Utils.cpp	Thu Jul 22 16:30:29 2010 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). 
+ * Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). 
  * All rights reserved.
  * This component and the accompanying materials are made available
  * under the terms of "Eclipse Public License v1.0"
@@ -19,7 +19,7 @@
 // INCLUDE FILES
 #include <commdb.h>
 #include <aknlistquerydialog.h>
-#include <ConnTest.rsg>
+#include <conntest.rsg>
 
 #include <aknselectionlist.h>
 #include <aknPopup.h>