[mapguide-commits] r5071 - in trunk/MgDev/Web/src: ApacheAgent IsapiAgent

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Aug 5 13:38:22 EDT 2010


Author: brucedechant
Date: 2010-08-05 17:38:22 +0000 (Thu, 05 Aug 2010)
New Revision: 5071

Modified:
   trunk/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp
   trunk/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp
Log:
Add missing exception handler to Apache and IIS agents.

Modified: trunk/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp
===================================================================
--- trunk/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp	2010-08-05 16:17:42 UTC (rev 5070)
+++ trunk/MgDev/Web/src/ApacheAgent/ApacheAgent.cpp	2010-08-05 17:38:22 UTC (rev 5071)
@@ -112,7 +112,10 @@
     }
 
     Initialize(r);
+    ApacheResponseHandler responseHandler(r);
 
+    MG_TRY()
+
     // Construct self Url.  It is embedded into the output stream
     // of some requests (like GetMap).  Use a fully qualified URL.
     string serverName = GetServerVariable(r, MapAgentStrings::ServerName);
@@ -202,8 +205,6 @@
     Ptr<MgPropertyCollection> paramList = params->GetParameters()->GetPropertyCollection();
     if (paramList != NULL)
     {
-        ApacheResponseHandler responseHandler(r);
-
         // Check to be sure that we have some kind of credentials before continuing.  Either
         // username/password or sessionid.
         bool bValid = paramList->Contains(MgHttpResourceStrings::reqSession);
@@ -233,6 +234,13 @@
         responseHandler.SendResponse(response);
     }
 
+    MG_CATCH(L"ApacheAgent.mgmapagent_handler");
+
+    if (mgException != NULL)
+    {
+        responseHandler.SendError(mgException);
+    }
+
     return OK;
 }
 

Modified: trunk/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp
===================================================================
--- trunk/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp	2010-08-05 16:17:42 UTC (rev 5070)
+++ trunk/MgDev/Web/src/IsapiAgent/IsapiAgent.cpp	2010-08-05 17:38:22 UTC (rev 5071)
@@ -50,6 +50,10 @@
 
 DWORD WINAPI HttpExtensionProc(EXTENSION_CONTROL_BLOCK *pECB)
 {
+    IsapiResponseHandler responseHandler(pECB);
+
+    MG_TRY()
+
     Initialize(pECB);
 
     // Construct self Url.  It is embedded into the output stream
@@ -169,8 +173,6 @@
     Ptr<MgPropertyCollection> paramList = params->GetParameters()->GetPropertyCollection();
     if (paramList != NULL)
     {
-        IsapiResponseHandler responseHandler(pECB);
-
         // Check to be sure that we have some kind of credentials before continuing.  Either
         // username/password or sessionid.
         bool bValid = paramList->Contains(MgHttpResourceStrings::reqSession);
@@ -206,6 +208,13 @@
         responseHandler.SendResponse(response);
     }
 
+    MG_CATCH(L"IsapiAgent.HttpExtensionProc");
+
+    if (mgException != NULL)
+    {
+        responseHandler.SendError(mgException);
+    }
+
     return HSE_STATUS_SUCCESS;
 }
 



More information about the mapguide-commits mailing list