Author: gonzalo
Date: 2005-05-08 15:34:07 -0400 (Sun, 08 May 2005)
New Revision: 44223

Modified:
   trunk/xsp/ChangeLog
   trunk/xsp/server/MonoWorkerRequest.cs
Log:
2005-05-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>

        * server/MonoWorkerRequest.cs: call the EndOfSend notification when
        the request is told to be ended.



Modified: trunk/xsp/ChangeLog
===================================================================
--- trunk/xsp/ChangeLog 2005-05-08 18:56:38 UTC (rev 44222)
+++ trunk/xsp/ChangeLog 2005-05-08 19:34:07 UTC (rev 44223)
@@ -1,3 +1,8 @@
+2005-05-08 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
+
+       * server/MonoWorkerRequest.cs: call the EndOfSend notification when
+       the request is told to be ended.
+
 2005-05-07  Ben Maurer  <[EMAIL PROTECTED]>
 
        * configure.in: put the full path to mono in RUNTIME

Modified: trunk/xsp/server/MonoWorkerRequest.cs
===================================================================
--- trunk/xsp/server/MonoWorkerRequest.cs       2005-05-08 18:56:38 UTC (rev 
44222)
+++ trunk/xsp/server/MonoWorkerRequest.cs       2005-05-08 19:34:07 UTC (rev 
44223)
@@ -84,6 +84,9 @@
                byte [] queryStringBytes;
                string hostVPath;
                string hostPath;
+               EndOfSendNotification end_send;
+               object end_send_data;
+               static EndOfRequestHandler eor = new EndOfRequestHandler 
(OnEndOfRequest);
 
                public MonoWorkerRequest (IApplicationHost appHost)
                        : base (String.Empty, String.Empty, null)
@@ -92,6 +95,7 @@
                                throw new ArgumentNullException ("appHost");
 
                        appHostBase = appHost;
+                       EndOfRequestEvent += eor;
                }
 
                public event MapPathEventHandler MapPathEvent;
@@ -233,11 +237,28 @@
                        HttpRuntime.ProcessRequest (this);
                }
 
+               static void OnEndOfRequest (HttpWorkerRequest req)
+               {
+                       try {
+                       MonoWorkerRequest mwr = (MonoWorkerRequest) req;
+                       if (mwr.end_send != null)
+                               mwr.end_send (mwr, mwr.end_send_data);
+                       } catch (Exception e) {
+                               Console.WriteLine (e);
+                       }
+               }
+
                public override void EndOfRequest ()
                {
                        if (EndOfRequestEvent != null)
                                EndOfRequestEvent (this);
                }
+               
+               public override void SetEndOfSendNotification 
(EndOfSendNotification callback, object extraData)
+               {
+                       end_send = callback;
+                       end_send_data = extraData;
+               }
 
                public override void SendCalculatedContentLength (int 
contentLength)
                {

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

Reply via email to