[mapguide-commits] r5293 - sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Oct 18 11:26:47 EDT 2010


Author: jng
Date: 2010-10-18 08:26:47 -0700 (Mon, 18 Oct 2010)
New Revision: 5293

Modified:
   sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
Log:
3.0 sandbox changes:
 - tweak the uri response string processing to be more mono-friendly (the old method broke mono)

Modified: sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs
===================================================================
--- sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2010-10-18 13:36:58 UTC (rev 5292)
+++ sandbox/maestro-3.0/OSGeo.MapGuide.MaestroAPI.Http/HttpServerConnection.cs	2010-10-18 15:26:47 UTC (rev 5293)
@@ -553,18 +553,26 @@
 			}
 #endif
         }
-
+        
         private void LogResponse(HttpWebResponse resp)
         {
-            OnRequestDispatched(string.Format("{0:d} {1} {2} {3}", resp.StatusCode, resp.StatusDescription, resp.Method, new Uri(this.BaseURL).MakeRelativeUri(resp.ResponseUri)));
+            OnRequestDispatched(string.Format("{0:d} {1} {2} {3}", resp.StatusCode, resp.StatusDescription, resp.Method, GetResponseString(resp)));
         }
 
+        private string GetResponseString(HttpWebResponse resp)
+        {
+            if (resp.Method == "GET")
+                return resp.ResponseUri.AbsolutePath + resp.ResponseUri.Query;
+            else
+                return resp.ResponseUri.AbsolutePath;
+        }
+
         private void LogFailedRequest(WebException ex)
         {
             var resp = ex.Response as HttpWebResponse;
             if (resp != null)
             {
-                OnRequestDispatched(string.Format("{0:d} {1} {2} {3}", resp.StatusCode, resp.StatusDescription, resp.Method, new Uri(this.BaseURL).MakeRelativeUri(resp.ResponseUri)));
+                OnRequestDispatched(string.Format("{0:d} {1} {2} {3}", resp.StatusCode, resp.StatusDescription, resp.Method, GetResponseString(resp)));
             }
         }
 



More information about the mapguide-commits mailing list