Author: krasnov
Date: 2008-01-24 09:32:00 -0500 (Thu, 24 Jan 2008)
New Revision: 93797

Modified:
   trunk/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs
Log:
fixof #9723, Reenable getping/setping, fixed by jonasm

Modified: trunk/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs
===================================================================
--- trunk/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs        
2008-01-24 14:17:46 UTC (rev 93796)
+++ trunk/mcs/class/Mainsoft.Web/Mainsoft.Web.Hosting/BaseHttpServlet.cs        
2008-01-24 14:32:00 UTC (rev 93797)
@@ -133,6 +133,30 @@
 
                protected override void service (HttpServletRequest req, 
HttpServletResponse resp)
                {
+                       const string assemblies = "/assemblies";
+                       const string getping = "getping";
+                       const string setping = "setping";
+                       string servletPath = req.getServletPath ();
+
+                       if (String.CompareOrdinal (assemblies, 0, servletPath, 
0, assemblies.Length) == 0) {
+                               if (servletPath.Length == assemblies.Length ||
+                                               servletPath [assemblies.Length] 
== '/') {
+                                       string requestURI = req.getRequestURI 
();
+                                       bool getp = requestURI.EndsWith 
(getping, StringComparison.Ordinal);
+                                       if (!getp && requestURI.EndsWith 
(setping, StringComparison.Ordinal)) {
+                                               getServletContext 
().setAttribute (getping, "1");
+                                               getp = true;
+                                       }
+
+                                       if (getp) {
+                                               string ping = (string) 
getServletContext ().getAttribute (getping);
+                                               if (ping == null)
+                                                       ping = "0";
+                                               resp.getOutputStream ().print 
(ping);
+                                               return;
+                                       }
+                               }
+                       }
                        resp.setContentType ("text/html");
 
                        try 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to