Author: gonzalo
Date: 2005-04-20 22:52:30 -0400 (Wed, 20 Apr 2005)
New Revision: 43375

Modified:
   trunk/xsp/ChangeLog
   trunk/xsp/server/XSPApplicationHost.cs
   trunk/xsp/server/XSPWorkerRequest.cs
Log:
2005-04-20 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * server/XSPWorkerRequest.cs:
        * server/XSPApplicationHost.cs: fix warnings and ensure we call Close
        if an error happens when writing to the stream.



Modified: trunk/xsp/ChangeLog
===================================================================
--- trunk/xsp/ChangeLog 2005-04-21 02:14:17 UTC (rev 43374)
+++ trunk/xsp/ChangeLog 2005-04-21 02:52:30 UTC (rev 43375)
@@ -1,3 +1,9 @@
+2005-04-20 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * server/XSPWorkerRequest.cs:
+       * server/XSPApplicationHost.cs: fix warnings and ensure we call Close
+       if an error happens when writing to the stream.
+
 2005-04-19 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * server/ModMonoWorkerRequest.cs:

Modified: trunk/xsp/server/XSPApplicationHost.cs
===================================================================
--- trunk/xsp/server/XSPApplicationHost.cs      2005-04-21 02:14:17 UTC (rev 
43374)
+++ trunk/xsp/server/XSPApplicationHost.cs      2005-04-21 02:52:30 UTC (rev 
43375)
@@ -114,8 +114,11 @@
                public void Close (int requestId, bool keepAlive)
                {
                        XSPWorker worker = (XSPWorker) GetWorker (requestId);
-                       if (worker != null)
-                               worker.Close (keepAlive);
+                       if (worker != null) {
+                               try {
+                                       worker.Close (keepAlive);
+                               } catch {}
+                       }
                }
        }
        
@@ -169,28 +172,6 @@
                        wr.FlushResponse (true);
                        wr.CloseConnection ();
                }
-
-               static string GetValueFromHeader (string header, string attr)
-               {
-                       int where = header.IndexOf (attr + '=');
-                       if (where == -1)
-                               return null;
-
-                       where += attr.Length + 1;
-                       int max = header.Length;
-                       if (where >= max)
-                               return String.Empty;
-
-                       char ending = header [where];
-                       if (ending != '"')
-                               ending = ' ';
-
-                       int end = header.Substring (where + 1).IndexOf (ending);
-                       if (end == -1)
-                               return (ending == '"') ? null : 
header.Substring (where);
-
-                       return header.Substring (where, end);
-               }
        }
        
        //
@@ -295,7 +276,12 @@
                
                public void Write (byte[] buffer, int position, int size)
                {
-                       stream.Write (buffer, position, size);
+                       try {
+                               stream.Write (buffer, position, size);
+                       } catch (Exception e) {
+                               Close ();
+                               throw;
+                       }
                }
                
                public void Close ()

Modified: trunk/xsp/server/XSPWorkerRequest.cs
===================================================================
--- trunk/xsp/server/XSPWorkerRequest.cs        2005-04-21 02:14:17 UTC (rev 
43374)
+++ trunk/xsp/server/XSPWorkerRequest.cs        2005-04-21 02:52:30 UTC (rev 
43375)
@@ -70,7 +70,6 @@
                bool haveContentLength;
                long contentSent;
                long contentLength;
-               bool isclosed;
 
                static string server_software;
                static string serverHeader;

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

Reply via email to