[mapguide-commits] r5180 - in branches/2.2/MgDev/Server/src: Common/Base Common/Manager Core Services/Feature Services/Kml Services/Mapping Services/Rendering Services/Resource Services/ServerAdmin Services/Site Services/Tile UnitTesting

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Sep 22 23:47:45 EDT 2010


Author: trevorwekel
Date: 2010-09-23 03:47:44 +0000 (Thu, 23 Sep 2010)
New Revision: 5180

Modified:
   branches/2.2/MgDev/Server/src/Common/Base/ClientHandler.cpp
   branches/2.2/MgDev/Server/src/Common/Base/ServiceOperation.cpp
   branches/2.2/MgDev/Server/src/Common/Manager/Connection.h
   branches/2.2/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
   branches/2.2/MgDev/Server/src/Common/Manager/LogManager.cpp
   branches/2.2/MgDev/Server/src/Common/Manager/LogManager.h
   branches/2.2/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp
   branches/2.2/MgDev/Server/src/Common/Manager/PackageLogHandler.h
   branches/2.2/MgDev/Server/src/Common/Manager/PermissionInfo.h
   branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.cpp
   branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.h
   branches/2.2/MgDev/Server/src/Common/Manager/ServiceManager.cpp
   branches/2.2/MgDev/Server/src/Common/Manager/SessionInfo.h
   branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.cpp
   branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.h
   branches/2.2/MgDev/Server/src/Core/Server.cpp
   branches/2.2/MgDev/Server/src/Core/main.cpp
   branches/2.2/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
   branches/2.2/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
   branches/2.2/MgDev/Server/src/Services/Kml/ServerKmlService.cpp
   branches/2.2/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
   branches/2.2/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
   branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepository.h
   branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
   branches/2.2/MgDev/Server/src/Services/Resource/DataBindingInfo.h
   branches/2.2/MgDev/Server/src/Services/Resource/OperationInfo.h
   branches/2.2/MgDev/Server/src/Services/Resource/OperationParameter.h
   branches/2.2/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h
   branches/2.2/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp
   branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp
   branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp
   branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp
   branches/2.2/MgDev/Server/src/Services/Site/ServerSiteService.cpp
   branches/2.2/MgDev/Server/src/Services/Tile/ServerTileService.cpp
   branches/2.2/MgDev/Server/src/UnitTesting/TestKmlService.cpp
Log:
Ticket #1423 Linux std::string not thread safe
- Submit changes for Server



Modified: branches/2.2/MgDev/Server/src/Common/Base/ClientHandler.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Base/ClientHandler.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Base/ClientHandler.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -213,8 +213,13 @@
 
     //  create a MgStreamData Object for our message queue
     MgStreamData* pData = NULL;
-    ACE_NEW_RETURN( pData, MgServerStreamData( this, handle, m_pStreamHelper ), -1 );
+    ACE_Allocator* allocator = ACE_Allocator::instance();
+    ACE_NEW_MALLOC_RETURN( pData,
+        static_cast<MgServerStreamData*>(allocator->malloc(sizeof(MgServerStreamData))),
+        MgServerStreamData( this, handle, m_pStreamHelper ), -1 );
 
+    //ACE_NEW_RETURN( pData, MgServerStreamData( this, handle, m_pStreamHelper ), -1 );
+
     //  create the message block
     ACE_Message_Block* mb = NULL;
     ACE_NEW_RETURN( mb, ACE_Message_Block( pData ), -1 );
@@ -282,6 +287,7 @@
 /// </summary>
 void MgClientHandler::SetStatus( MgClientHandler::HandlerStatus status )
 {
+    ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex));
     m_Status = status;
 };
 

Modified: branches/2.2/MgDev/Server/src/Common/Base/ServiceOperation.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Base/ServiceOperation.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Base/ServiceOperation.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -219,7 +219,7 @@
     {
         // Log the exception using Server locale or User locale if it exists
         STRING locale = MgResources::DefaultMessageLocale;
-        MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
         if (NULL != currUserInfo)
         {
             locale = currUserInfo->GetLocale();
@@ -644,7 +644,7 @@
 
     if (serverManager->IsSiteServer())
     {
-        MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
         assert(NULL != currUserInfo);
         Ptr<MgStringCollection> requiredRoles = GetRoles();
 

Modified: branches/2.2/MgDev/Server/src/Common/Manager/Connection.h
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/Connection.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/Connection.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -85,10 +85,10 @@
     void SetCurrentOperationStatus(OperationStatus opStatus);
     void SetCurrentOperationTime(INT32 opTime);
 
-    CREFSTRING GetClientAgent() const;
-    CREFSTRING GetClientIp() const;
-    CREFSTRING GetUserName() const;
-    CREFSTRING GetSessionId() const;
+    STRING GetClientAgent() const;
+    STRING GetClientIp() const;
+    STRING GetUserName() const;
+    STRING GetSessionId() const;
     const ACE_Time_Value& GetLastUsageTime() const;
     const ACE_Time_Value& GetStartTime() const;
     INT32 GetProcessedOperations() const;
@@ -127,22 +127,22 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgConnection::GetClientAgent() const
+inline STRING MgConnection::GetClientAgent() const
 {
     return m_clientAgent;
 }
 
-inline CREFSTRING MgConnection::GetClientIp() const
+inline STRING MgConnection::GetClientIp() const
 {
     return m_clientIp;
 }
 
-inline CREFSTRING MgConnection::GetUserName() const
+inline STRING MgConnection::GetUserName() const
 {
     return m_userName;
 }
 
-inline CREFSTRING MgConnection::GetSessionId() const
+inline STRING MgConnection::GetSessionId() const
 {
     return m_sessionId;
 }

Modified: branches/2.2/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/FdoConnectionManager.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -2006,7 +2006,7 @@
 ///
 void MgFdoConnectionManager::SubstituteConnectionTags(REFSTRING connectionStr)
 {
-    MgUserInformation* userInfo =  MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo =  MgUserInformation::GetCurrentUserInfo();
 
     if (NULL != userInfo)
     {

Modified: branches/2.2/MgDev/Server/src/Common/Manager/LogManager.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/LogManager.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/LogManager.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -319,7 +319,7 @@
     MG_LOGMANAGER_CATCH_AND_THROW(L"MgLogManager.LoadConfigurationProperties")
 }
 
-CREFSTRING MgLogManager::GetLogsPath()
+STRING MgLogManager::GetLogsPath()
 {
     return m_path;
 }
@@ -2381,9 +2381,14 @@
     MG_LOGMANAGER_TRY()
 
     // We want the log thread to handle the log entry for us
-    MgLogEntryData* led;
-    ACE_NEW_NORETURN( led, MgLogEntryData(logType, message, logPriority) );
+    MgLogEntryData* led = NULL;
+    ACE_Allocator* allocator = ACE_Allocator::instance();
+    ACE_NEW_MALLOC_NORETURN (led,
+        static_cast<MgLogEntryData*> (allocator->malloc(sizeof(MgLogEntryData))),
+        MgLogEntryData(logType, message, logPriority) );
 
+    //ACE_NEW_NORETURN( led, MgLogEntryData(logType, message, logPriority) );
+
     ACE_Message_Block* mb;
     ACE_NEW_NORETURN( mb, ACE_Message_Block( led ) );
     if(mb)
@@ -2442,11 +2447,14 @@
 
         MG_LOGMANAGER_TRY()
 
-        LogToSysLog(pAce, (char *)(MgUtil::WideCharToMultiByte(m_applicationName)).c_str());
+        string appName = MgUtil::WideCharToMultiByte(m_applicationName);
+        wchar_t* messageStr = (wchar_t*) message.c_str();
+
+        LogToSysLog(pAce, (char *)appName.c_str());
 #ifdef _WIN32
         pAce->log(logPriority, ACE_TEXT("%Z\r\n"), message.c_str()); // WAS %W
 #else
-        pAce->log(logPriority, ACE_TEXT("%Z\n"), message.c_str()); // WAS %W
+        pAce->log(logPriority, ACE_TEXT("%Z\n"), messageStr); // WAS %W
 #endif
         LogToStderr(pAce);
 
@@ -2735,23 +2743,11 @@
     if (pReadFile != NULL)
     {
         const int size = 2048;
-        char* buffer = new char[size];
-        if (buffer == NULL)
-        {
-            ACE_OS::fclose(pReadFile);
-            throw new MgOutOfMemoryException(L"MgLogManager.GetLogHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-        }
+        char buffer[2048] = {0};
 
-        // Clear buffer
-        memset(buffer, 0, (size)*sizeof(char));
-
-        ACE_OS::fread(buffer, sizeof(char), size*sizeof(char), pReadFile);
+        ACE_OS::fread(buffer, sizeof(char), size-1, pReadFile);
         contents = buffer;
 
-        // Clean up buffer
-        delete [] buffer;
-        buffer = NULL;
-
         ACE_OS::fclose(pReadFile);
     }
 

Modified: branches/2.2/MgDev/Server/src/Common/Manager/LogManager.h
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/LogManager.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/LogManager.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -212,7 +212,7 @@
     STRING connInfoUserName = L""; \
     try \
     { \
-        MgUserInformation* pUserInfo = MgUserInformation::GetCurrentUserInfo(); \
+        Ptr<MgUserInformation> pUserInfo = MgUserInformation::GetCurrentUserInfo(); \
         MgConnection* pConnection = MgConnection::GetCurrentConnection(); \
         /* Get client version. This needs to come from the web tier. */ \
         /* For logs involving operations, this will be stored in MgUserInformation. */ \
@@ -288,7 +288,7 @@
     static MgLogManager* GetInstance();
     void Initialize();
     void LoadConfigurationProperties();
-    CREFSTRING GetLogsPath();
+    STRING GetLogsPath();
     void SetMaximumLogSize(INT32 size);
     void SetLogDelimiter(CREFSTRING delimiter);
     STRING GetLogDelimiter();

Modified: branches/2.2/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/LongTransactionManager.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -76,7 +76,7 @@
     ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, sm_mutex, false));
 
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 

Modified: branches/2.2/MgDev/Server/src/Common/Manager/PackageLogHandler.h
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/PackageLogHandler.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/PackageLogHandler.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -70,8 +70,8 @@
 
     virtual void Dispose();
 
-    CREFSTRING GetPackagePathname() const;
-    CREFSTRING GetLogPathname() const;
+    STRING GetPackagePathname() const;
+    STRING GetLogPathname() const;
     MgPackageStatusInformation& GetStatusInfo();
 
     void End();
@@ -96,12 +96,12 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgPackageLogHandler::GetPackagePathname() const
+inline STRING MgPackageLogHandler::GetPackagePathname() const
 {
     return m_packagePathname;
 }
 
-inline CREFSTRING MgPackageLogHandler::GetLogPathname() const
+inline STRING MgPackageLogHandler::GetLogPathname() const
 {
     return m_logPathname;
 }

Modified: branches/2.2/MgDev/Server/src/Common/Manager/PermissionInfo.h
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/PermissionInfo.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/PermissionInfo.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -61,7 +61,7 @@
 public:
 
     time_t GetAccessedTime() const;
-    CREFSTRING GetOwner() const;
+    STRING GetOwner() const;
     bool IsInherited() const;
     const MgUserPermissionMap& GetUserPermissionMap() const;
     const MgGroupPermissionMap& GetGroupPermissionMap() const;
@@ -96,7 +96,7 @@
     return m_accessedTime;
 }
 
-inline CREFSTRING MgPermissionInfo::GetOwner() const
+inline STRING MgPermissionInfo::GetOwner() const
 {
     return m_owner;
 }

Modified: branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -262,7 +262,7 @@
     MG_CATCH_AND_THROW(L"MgServerManager.LoadConfigurationProperties")
 }
 
-CREFSTRING MgServerManager::GetDefaultMessageLocale()
+STRING MgServerManager::GetDefaultMessageLocale()
 {
     return m_defaultMessageLocale;
 }
@@ -799,7 +799,7 @@
     return m_nAdminThreads;
 }
 
-CREFSTRING MgServerManager::GetAdminEmail()
+STRING MgServerManager::GetAdminEmail()
 {
     return m_adminEmail;
 }

Modified: branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.h
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/ServerManager.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -54,7 +54,7 @@
     void Initialize(CREFSTRING locale);
     void LoadConfigurationProperties();
 
-    CREFSTRING GetDefaultMessageLocale();
+    STRING GetDefaultMessageLocale();
 
     MgPropertyCollection* GetConfigurationProperties(CREFSTRING propertySection);
     void SetConfigurationProperties(CREFSTRING propertySection, MgPropertyCollection* properties);
@@ -68,20 +68,20 @@
     void SetDocument(CREFSTRING identifier, MgByteReader* data);
 
     bool IsSiteServer() const;
-    CREFSTRING GetServerName() const;
-    CREFSTRING GetLocalServerAddress() const;
+    STRING GetServerName() const;
+    STRING GetLocalServerAddress() const;
 
     // Admin Properties
     INT32 GetAdminPort();
     INT32 GetAdminThreads();
-    CREFSTRING GetAdminEmail();
+    STRING GetAdminEmail();
 
     // Client Properties
     INT32 GetClientPort();
     INT32 GetClientThreads();
 
     // Site Properties
-    CREFSTRING GetSiteServerAddress() const;
+    STRING GetSiteServerAddress() const;
     INT32 GetSitePort();
     INT32 GetSiteThreads();
 
@@ -201,17 +201,17 @@
     return m_isSiteServer;
 }
 
-inline CREFSTRING MgServerManager::GetServerName() const
+inline STRING MgServerManager::GetServerName() const
 {
     return m_displayName;
 }
 
-inline CREFSTRING MgServerManager::GetLocalServerAddress() const
+inline STRING MgServerManager::GetLocalServerAddress() const
 {
     return m_localServerAddress;
 }
 
-inline CREFSTRING MgServerManager::GetSiteServerAddress() const
+inline STRING MgServerManager::GetSiteServerAddress() const
 {
     return m_siteServerAddress;
 }

Modified: branches/2.2/MgDev/Server/src/Common/Manager/ServiceManager.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/ServiceManager.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/ServiceManager.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -165,7 +165,7 @@
 ///
 MgService* MgServiceManager::RequestLocalService(INT32 serviceType)
 {
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     Ptr<MgConnectionProperties> connProp = new MgConnectionProperties(
         currUserInfo, L"", 0);
 
@@ -186,7 +186,7 @@
     serverAddress = m_loadBalanceManager->RequestServer(serviceType);
 
     // Use the site port for Site/Support Server communications.
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     Ptr<MgConnectionProperties> connProp = new MgConnectionProperties(
         currUserInfo, serverAddress, m_serverManager->GetSitePort());
 

Modified: branches/2.2/MgDev/Server/src/Common/Manager/SessionInfo.h
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/SessionInfo.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/SessionInfo.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -44,9 +44,9 @@
 
 public:
 
-    CREFSTRING GetUser() const;
-    CREFSTRING GetClient() const;
-    CREFSTRING GetClientIp() const;
+    STRING GetUser() const;
+    STRING GetClient() const;
+    STRING GetClientIp() const;
     const MgDateTime& GetStartTime() const;
     MgDateTime GetEndTime() const;
     const ACE_Time_Value& GetAccessedTime() const;
@@ -75,17 +75,17 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgSessionInfo::GetUser() const
+inline STRING MgSessionInfo::GetUser() const
 {
     return m_user;
 }
 
-inline CREFSTRING MgSessionInfo::GetClient() const
+inline STRING MgSessionInfo::GetClient() const
 {
     return m_client;
 }
 
-inline CREFSTRING MgSessionInfo::GetClientIp() const
+inline STRING MgSessionInfo::GetClientIp() const
 {
     return m_clientIp;
 }

Modified: branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -88,7 +88,7 @@
 /// </summary>
 ///----------------------------------------------------------------------------
 
-CREFSTRING MgUserInfo::GetPassword() const
+STRING MgUserInfo::GetPassword() const
 {
     if (m_passwordEncrypted)
     {

Modified: branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.h
===================================================================
--- branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Common/Manager/UserInfo.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -39,7 +39,7 @@
 public:
 
     void SetPassword(CREFSTRING password, bool passwordEncrypted = false);
-    CREFSTRING GetPassword() const;
+    STRING GetPassword() const;
 
 /// Data Members
 

Modified: branches/2.2/MgDev/Server/src/Core/Server.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Core/Server.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Core/Server.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -1196,7 +1196,7 @@
 
     MG_TRY()
 
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
 
     if (NULL != currUserInfo)
     {

Modified: branches/2.2/MgDev/Server/src/Core/main.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Core/main.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Core/main.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -72,8 +72,20 @@
     XMLPlatformUtils::Initialize();
 
 #ifndef _WIN32
-    // Set memory checking to report only and not abort
-    mallopt(M_CHECK_ACTION, 1);
+    MgConfiguration* pConfiguration = MgConfiguration::GetInstance();
+    pConfiguration->LoadConfiguration(MgConfigProperties::ServerConfigurationFilename);
+    bool bDebugMem = false;
+    pConfiguration->GetBoolValue(MgConfigProperties::GeneralPropertiesSection, MgConfigProperties::GeneralPropertyLinuxMemDebug, bDebugMem, MgConfigProperties::DefaultGeneralPropertyLinuxMemDebug);
+    if (!bDebugMem)
+    {
+        // Set memory checking to report only and not abort
+        mallopt(M_CHECK_ACTION, 1);
+    }
+    else
+    {
+        // Set memory checking to report and abort
+        mallopt(M_CHECK_ACTION, 3);
+    }
 #endif
 
     MG_TRY()

Modified: branches/2.2/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Feature/ServerFeatureService.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -265,7 +265,7 @@
 {
     MG_LOG_TRACE_ENTRY(L"MgServerFeatureService::GetCapabilities()");
 
-    MgUserInformation* userInfo =  MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo =  MgUserInformation::GetCurrentUserInfo();
     if (userInfo->GetApiVersion() != MG_API_VERSION(1,0,0) && userInfo->GetApiVersion() != MG_API_VERSION(2,0,0))
     {
         throw new MgInvalidOperationVersionException(
@@ -1020,7 +1020,7 @@
 
     // we require a session ID
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 

Modified: branches/2.2/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Feature/ServerGetProviderCapabilities.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -74,7 +74,7 @@
     // no more risk of exceptions, so we can now assign these
     m_fdoConn = fdoConn.Detach();
     m_providerName = providerNoVersion;
-    MgUserInformation* userInfo =  MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo =  MgUserInformation::GetCurrentUserInfo();
     m_version = userInfo->GetApiVersion();
 }
 

Modified: branches/2.2/MgDev/Server/src/Services/Kml/ServerKmlService.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Kml/ServerKmlService.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Kml/ServerKmlService.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -255,7 +255,8 @@
     {
         // Create a new, empty map
         Ptr<MgSiteConnection> siteConn = new MgSiteConnection();
-        siteConn->Open(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        siteConn->Open(userInfo);
         Ptr<MgMap> map = new MgMap(siteConn);
         map->Create(GOOGLE_EARTH_WKT, extents, L"Google Earth Map");
         map->SetDisplayWidth(width);
@@ -846,7 +847,7 @@
 STRING MgServerKmlService::GetSessionId()
 {
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
     {
         sessionId = userInfo->GetMgSessionId();

Modified: branches/2.2/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Mapping/ServerMappingService.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -468,7 +468,7 @@
 
     // get the session ID
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 
@@ -1203,7 +1203,7 @@
 
         // Get the session ID
         STRING sessionId;
-        MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
         if (userInfo != NULL)
             sessionId = userInfo->GetMgSessionId();
 

Modified: branches/2.2/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Rendering/ServerRenderingService.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -828,7 +828,7 @@
 
     // get the session ID
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 
@@ -1137,7 +1137,7 @@
 
     // get the session ID
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
         sessionId = userInfo->GetMgSessionId();
 

Modified: branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepository.h
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepository.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepository.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -45,7 +45,7 @@
     public:
 
         MgResourceDatabase* GetResourceDataStreamDatabase() const;
-        CREFSTRING GetResourceDataFilePath() const;
+        STRING GetResourceDataFilePath() const;
 
 /// Data Members
 
@@ -57,7 +57,7 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgApplicationRepository::GetResourceDataFilePath() const
+inline STRING MgApplicationRepository::GetResourceDataFilePath() const
 {
     return m_resourceDataFilePath;
 }

Modified: branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Resource/ApplicationRepositoryManager.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -54,7 +54,7 @@
     // up based on the current session ID.
 
     m_currUserInfo = new MgUserInformation;
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     assert(NULL != currUserInfo);
     STRING sessionId = currUserInfo->GetMgSessionId();
     STRING userName = currUserInfo->GetUserName();

Modified: branches/2.2/MgDev/Server/src/Services/Resource/DataBindingInfo.h
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Resource/DataBindingInfo.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Resource/DataBindingInfo.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -34,10 +34,10 @@
 
         MgDataBindingInfo& operator=(const MgDataBindingInfo& dataBindingInfo);
 
-        CREFSTRING GetPreProcessTags() const;
-        CREFSTRING GetResourceDataFilePath() const;
-        CREFSTRING GetLoginUsername() const;
-        CREFSTRING GetLoginPassword() const;
+        STRING GetPreProcessTags() const;
+        STRING GetResourceDataFilePath() const;
+        STRING GetLoginUsername() const;
+        STRING GetLoginPassword() const;
         bool GetSubstituteUnmanagedDataMappings() const;
 
         void SetPreProcessTags(CREFSTRING preProcessTags);
@@ -59,22 +59,22 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgDataBindingInfo::GetPreProcessTags() const
+inline STRING MgDataBindingInfo::GetPreProcessTags() const
 {
     return m_preProcessTags;
 }
 
-inline CREFSTRING MgDataBindingInfo::GetResourceDataFilePath() const
+inline STRING MgDataBindingInfo::GetResourceDataFilePath() const
 {
     return m_resourceDataFilePath;
 }
 
-inline CREFSTRING MgDataBindingInfo::GetLoginUsername() const
+inline STRING MgDataBindingInfo::GetLoginUsername() const
 {
     return m_loginUsername;
 }
 
-inline CREFSTRING MgDataBindingInfo::GetLoginPassword() const
+inline STRING MgDataBindingInfo::GetLoginPassword() const
 {
     return m_loginPassword;
 }

Modified: branches/2.2/MgDev/Server/src/Services/Resource/OperationInfo.h
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Resource/OperationInfo.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Resource/OperationInfo.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -58,10 +58,10 @@
 public:
     MgOperationInfo& operator=(const MgOperationInfo& opInfo);
 
-    CREFSTRING GetName() const;
+    STRING GetName() const;
     void SetName(CREFSTRING name);
 
-    CREFSTRING GetVersion() const;
+    STRING GetVersion() const;
     void SetVersion(CREFSTRING version);
 
     const MgOperationParameter& GetParameter(CREFSTRING name,
@@ -86,13 +86,13 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgOperationInfo::GetName() const
+inline STRING MgOperationInfo::GetName() const
 {
     return m_name;
 }
 
 
-inline CREFSTRING MgOperationInfo::GetVersion() const
+inline STRING MgOperationInfo::GetVersion() const
 {
     return m_version;
 }

Modified: branches/2.2/MgDev/Server/src/Services/Resource/OperationParameter.h
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Resource/OperationParameter.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Resource/OperationParameter.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -32,10 +32,10 @@
 public:
     MgOperationParameter& operator=(const MgOperationParameter& opParam);
 
-    CREFSTRING GetValue() const;
+    STRING GetValue() const;
     void SetValue(CREFSTRING value);
 
-    CREFSTRING GetContentType() const;
+    STRING GetContentType() const;
     void SetContentType(CREFSTRING contentType);
 
 /// Data Members
@@ -67,13 +67,13 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgOperationParameter::GetValue() const
+inline STRING MgOperationParameter::GetValue() const
 {
     return m_value;
 }
 
 
-inline CREFSTRING MgOperationParameter::GetContentType() const
+inline STRING MgOperationParameter::GetContentType() const
 {
     return m_contentType;
 }

Modified: branches/2.2/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Resource/ResourcePackageManifestHandler.h	2010-09-23 03:47:44 UTC (rev 5180)
@@ -41,7 +41,7 @@
 
 public:
 
-    CREFSTRING GetDescription() const;
+    STRING GetDescription() const;
     void SetDescription(CREFSTRING description);
 
 /// Data Members
@@ -58,7 +58,7 @@
 
 /// Inline Methods
 
-inline CREFSTRING MgResourcePackageManifestHandler::GetDescription() const
+inline STRING MgResourcePackageManifestHandler::GetDescription() const
 {
     return m_description;
 }

Modified: branches/2.2/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Resource/SiteRepositoryManager.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -211,7 +211,7 @@
         // TODO: Remove this option if it is not in use.
 
         MgSecurityManager securityMan;
-        MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+        Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
         assert(NULL != currUserInfo);
         STRING userName = currUserInfo->GetUserName();
 

Modified: branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpNotifyResourcesChanged.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -86,7 +86,8 @@
 
         // Validate() not called here because this is an internal server-only operation.
         // Instead, MgSecurityManager::Authenticate() should be called to perform authentication.
-        MgSecurityManager::Authenticate(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        MgSecurityManager::Authenticate(userInfo);
 
         m_service->NotifyResourcesChanged(resources);
 

Modified: branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpRegisterServicesOnServers.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -76,7 +76,8 @@
 
         // Validate() not called here because this is an internal server-only operation.
         // Instead, MgSecurityManager::Authenticate() should be called to perform authentication.
-        MgSecurityManager::Authenticate(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        MgSecurityManager::Authenticate(userInfo);
 
         Ptr<MgSerializableCollection> feedbackList = m_service->RegisterServicesOnServers(serverInfoList);
 

Modified: branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/ServerAdmin/OpUnregisterServicesOnServers.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -76,7 +76,8 @@
 
         // Validate() not called here because this is an internal server-only operation.
         // Instead, MgSecurityManager::Authenticate() should be called to perform authentication.
-        MgSecurityManager::Authenticate(MgUserInformation::GetCurrentUserInfo());
+        Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+        MgSecurityManager::Authenticate(userInfo);
 
         m_service->UnregisterServicesOnServers(serverInfoList);
 

Modified: branches/2.2/MgDev/Server/src/Services/Site/ServerSiteService.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Site/ServerSiteService.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Site/ServerSiteService.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -728,7 +728,7 @@
 STRING MgServerSiteService::CreateSession()
 {
     STRING session;
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     assert(NULL != currUserInfo);
 
     MG_SITE_SERVICE_TRY()
@@ -839,7 +839,7 @@
 {
     STRING session;
     STRING userId;
-    MgUserInformation* currUserInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> currUserInfo = MgUserInformation::GetCurrentUserInfo();
     assert(NULL != currUserInfo);
 
     MG_SITE_SERVICE_TRY()
@@ -1067,7 +1067,7 @@
 {
     bool bAllowed = false;
 
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     STRING currUser = userInfo->GetUserName();
     if (currUser.empty())
     {

Modified: branches/2.2/MgDev/Server/src/Services/Tile/ServerTileService.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/Services/Tile/ServerTileService.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/Services/Tile/ServerTileService.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -234,7 +234,8 @@
             else
             {
                 Ptr<MgSiteConnection> siteConn = new MgSiteConnection();
-                siteConn->Open(MgUserInformation::GetCurrentUserInfo());
+                Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
+                siteConn->Open(userInfo);
                 map = new MgMap(siteConn);
                 map->Create(resourceService, mapDefinition, mapString);
                 cachedMap = new MgMemoryStreamHelper();

Modified: branches/2.2/MgDev/Server/src/UnitTesting/TestKmlService.cpp
===================================================================
--- branches/2.2/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2010-09-23 03:46:54 UTC (rev 5179)
+++ branches/2.2/MgDev/Server/src/UnitTesting/TestKmlService.cpp	2010-09-23 03:47:44 UTC (rev 5180)
@@ -416,7 +416,7 @@
     STRING newContent = content;
 
     STRING sessionId;
-    MgUserInformation* userInfo = MgUserInformation::GetCurrentUserInfo();
+    Ptr<MgUserInformation> userInfo = MgUserInformation::GetCurrentUserInfo();
     if (userInfo != NULL)
     {
         sessionId = userInfo->GetMgSessionId();



More information about the mapguide-commits mailing list