Author: krasnov
Date: 2006-01-09 13:01:59 -0500 (Mon, 09 Jan 2006)
New Revision: 55250

Modified:
   trunk/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
   trunk/mcs/class/System.Web/System.Web/ChangeLog
   trunk/mcs/class/System.Web/System.Web/HttpException.cs
   trunk/mcs/class/System.Web/System.Web/HttpRequest.cs
   trunk/mcs/class/System.Web/System.Web/HttpResponse.cs
   trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs
Log:
* CapabilitiesLoader.cs: Merged TARGET_JVM parts in LoadFile from /main/9
* HttpException.cs: Merged TARGET_JVM parts in GetHtmlizedErrorMessage from 
/main/13
* HttpRequest.cs: Merged TARGET_JVM parts in MapPath from /main/29
* HttpResponse.cs: Merged TARGET_JVM parts in End() from /main/30
* StaticFileHandler.cs: Merged TARGET_JVM parts in ProcessRequest from /main/7

Modified: trunk/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs 2006-01-09 
17:51:19 UTC (rev 55249)
+++ trunk/mcs/class/System.Web/System.Web/CapabilitiesLoader.cs 2006-01-09 
18:01:59 UTC (rev 55250)
@@ -224,7 +224,19 @@
                static void LoadFile (string filename)
                {
 #if TARGET_J2EE
-                       TextReader input = GetJavaTextReader(filename);
+                       Stream s;
+                       try {
+                               string custom = String.Concat("browscap/", 
filename);
+                               s = 
(Stream)vmw.common.IOUtils.getStreamForGHConfigs(custom);
+                               if (s == null)
+                                       s = 
(Stream)vmw.common.IOUtils.getStreamForGHConfigs(filename);
+                               if (s == null)
+                                       return;
+                       }
+                       catch (Exception e) {
+                               return;
+                       }
+                       TextReader input = new StreamReader (s);
                        if(input == null)
                                return;
 #else

Modified: trunk/mcs/class/System.Web/System.Web/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web/ChangeLog     2006-01-09 17:51:19 UTC 
(rev 55249)
+++ trunk/mcs/class/System.Web/System.Web/ChangeLog     2006-01-09 18:01:59 UTC 
(rev 55250)
@@ -1,3 +1,14 @@
+2006-01-09  Vladimir Krasnov <[EMAIL PROTECTED]>
+
+       * CapabilitiesLoader.cs: Merged TARGET_JVM parts in LoadFile
+       from /main/9
+       * HttpException.cs: Merged TARGET_JVM parts in GetHtmlizedErrorMessage
+       from /main/13
+       * HttpRequest.cs: Merged TARGET_JVM parts in MapPath from /main/29
+       * HttpResponse.cs: Merged TARGET_JVM parts in End() from /main/30
+       * StaticFileHandler.cs: Merged TARGET_JVM parts in ProcessRequest
+       from /main/7
+
 2006-01-08  Konstantin Triger <[EMAIL PROTECTED]>
 
        * BrowserCapabilities.cs, HttpBrowserCapabilities.cs,

Modified: trunk/mcs/class/System.Web/System.Web/HttpException.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpException.cs      2006-01-09 
17:51:19 UTC (rev 55249)
+++ trunk/mcs/class/System.Web/System.Web/HttpException.cs      2006-01-09 
18:01:59 UTC (rev 55250)
@@ -35,9 +35,7 @@
 using System.Security.Permissions;
 using System.Text;
 using System.Web.Util;
-#if !TARGET_J2EE
 using System.Web.Compilation;
-#endif
 
 namespace System.Web
 {
@@ -164,42 +162,7 @@
                        string res = HttpUtility.HtmlEncode (s);
                        return res.Replace ("\r\n", "<br />");
                }
-#if TARGET_J2EE
-               string GetHtmlizedErrorMessage ()
-               {
-                       StringBuilder builder = new StringBuilder 
("<html>\r\n<title>");
-                       HtmlizedException exc = (HtmlizedException) 
this.InnerException;
-                       builder.Append (exc.Title);
-                       builder.AppendFormat ("</title><body 
bgcolor=\"white\">" +
-                                             "<h1><font color=\"red\">Server 
Error in '{0}' " +
-                                             "Application</font></h1><hr>\r\n",
-                                             
HttpRuntime.AppDomainAppVirtualPath);
-               
-                       builder.AppendFormat ("<h2><font 
color=\"maroon\"><i>{0}</i></font></h2>\r\n", exc.Title);
-                       builder.AppendFormat ("<b>Description: 
</b>{0}\r\n<p>\r\n", HtmlEncode (exc.Description));
-                       builder.AppendFormat ("<b>Error message: 
</b>{0}\r\n<p>\r\n", HtmlEncode (exc.ErrorMessage));
 
-                       if (exc.FileName != null)
-                               builder.AppendFormat ("<b>File name: </b> {0}", 
HtmlEncode (exc.FileName));
-
-                       if (exc.FileText != null) {
-                               if (exc.SourceFile != exc.FileName)
-                                       builder.AppendFormat ("<p><b>Source 
File: </b>{0}", exc.SourceFile);
-
-                               builder.Append ("\r\n<p>\r\n");
-
-                               builder.Append ("<table summary=\"Source file\" 
width=\"100%\" " +
-                                                       
"bgcolor=\"#ffffc\">\r\n<tr><td>");
-                                       WriteSource (builder, exc);
-                                       builder.Append 
("</td></tr>\r\n</table>\r\n<p>\r\n");
-                       }
-
-                       builder.Append ("<hr>\r\n</body>\r\n</html>\r\n");
-                       builder.AppendFormat ("<!--\r\n{0}\r\n-->\r\n", 
HtmlEncode (exc.ToString ()));
-                       builder.AppendFormat ("<!--\r\n{0}\r\n-->\r\n", 
HtmlEncode (exc.StackTrace));
-                       return builder.ToString ();
-               }
-#else
                string GetHtmlizedErrorMessage ()
                {
                        StringBuilder builder = new StringBuilder 
("<html>\r\n<title>");
@@ -244,9 +207,12 @@
                        
                        builder.Append ("<hr>\r\n</body>\r\n</html>\r\n");
                        builder.AppendFormat ("<!--\r\n{0}\r\n-->\r\n", 
HtmlEncode (exc.ToString ()));
+#if TARGET_JVM
+                       builder.AppendFormat ("<!--\r\n{0}\r\n-->\r\n", 
HtmlEncode (exc.StackTrace));
+#endif
                        return builder.ToString ();
                }
-#endif
+
                static void WriteTextAsCode (StringBuilder builder, string text)
                {
                        builder.Append ("<code><pre>\r\n");

Modified: trunk/mcs/class/System.Web/System.Web/HttpRequest.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpRequest.cs        2006-01-09 
17:51:19 UTC (rev 55249)
+++ trunk/mcs/class/System.Web/System.Web/HttpRequest.cs        2006-01-09 
18:01:59 UTC (rev 55250)
@@ -1051,6 +1051,15 @@
                        if (worker_request == null)
                                throw new HttpException ("No 
HttpWorkerRequest");
 
+#if TARGET_J2EE
+                       if (baseVirtualDir.Equals(BaseVirtualDir))
+                       {
+                               string val =  
System.Web.J2EE.PageMapper.GetFromMapPathCache(virtualPath);
+                               if (val != null)                                
+                                       return val;                             
+                       }
+#endif 
+
                        if (virtualPath == null || virtualPath == "")
                                virtualPath = "";
                        else
@@ -1060,6 +1069,11 @@
                                throw new ArgumentNullException (
                                        String.Format ("MapPath: Invalid path 
'{0}', only virtual paths are accepted", virtualPath));
 
+#if TARGET_J2EE
+                       if 
(virtualPath.StartsWith(vmw.common.IAppDomainConfig.WAR_ROOT_SYMBOL))           
             
+                               return  virtualPath;                    
+#endif 
+
                        if (System.IO.Path.DirectorySeparatorChar != '/')
                                virtualPath.Replace 
(System.IO.Path.DirectorySeparatorChar, '/');
 

Modified: trunk/mcs/class/System.Web/System.Web/HttpResponse.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/HttpResponse.cs       2006-01-09 
17:51:19 UTC (rev 55249)
+++ trunk/mcs/class/System.Web/System.Web/HttpResponse.cs       2006-01-09 
18:01:59 UTC (rev 55250)
@@ -536,7 +536,12 @@
                public void End ()
                {
                        if (context.TimeoutPossible) {
+#if TARGET_JVM
+                               Flush();
+                               throw new [EMAIL PROTECTED]();
+#else
                                Thread.CurrentThread.Abort (FlagEnd);
+#endif
                        } else {
                                // If this is called from an async event, 
signal the completion
                                // but don't thow.
@@ -827,7 +832,11 @@
                        Flush ();
                }
 
-#if !TARGET_JVM
+#if TARGET_JVM
+               public void WriteFile (IntPtr fileHandle, long offset, long 
size) {
+                       throw new NotSupportedException("IntPtr not supported");
+               }
+#else
                public void WriteFile (IntPtr fileHandle, long offset, long 
size)
                {
                        if (offset < 0)

Modified: trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs  2006-01-09 
17:51:19 UTC (rev 55249)
+++ trunk/mcs/class/System.Web/System.Web/StaticFileHandler.cs  2006-01-09 
18:01:59 UTC (rev 55250)
@@ -54,7 +54,21 @@
                        try {
                                if (strHeader != null) {
                                        DateTime dtIfModifiedSince = 
DateTime.ParseExact (strHeader, "r", null);
-                                       DateTime ftime = 
fi.LastWriteTime.ToUniversalTime ();
+                                       DateTime ftime;
+#if TARGET_JVM
+                                       try 
+                                       {
+                                               ftime = 
fi.LastWriteTime.ToUniversalTime ();
+                                       } 
+                                       catch (NotSupportedException) 
+                                       {
+                                               // The file is in a WAR, it was 
not modified.
+                                               response.StatusCode = 304;
+                                               return;
+                                       }
+#else
+                                       ftime = 
fi.LastWriteTime.ToUniversalTime ();
+#endif
                                        if (ftime <= dtIfModifiedSince) {
                                                response.StatusCode = 304;
                                                return;

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

Reply via email to