Преглед изворни кода

2003-07-23 Gonzalo Paniagua Javier <[email protected]>

	* HttpResponseStreamProxy.cs: reformatted. Fixed infinite recursion in
	Write method.

	* HttpWriter.cs: flush the filter after writing.

svn path=/trunk/mcs/; revision=16577
Gonzalo Paniagua Javier пре 22 година
родитељ
комит
c047ea90b8

+ 7 - 0
mcs/class/System.Web/System.Web/ChangeLog

@@ -1,3 +1,10 @@
+2003-07-23  Gonzalo Paniagua Javier <[email protected]>
+
+	* HttpResponseStreamProxy.cs: reformatted. Fixed infinite recursion in
+	Write method.
+
+	* HttpWriter.cs: flush the filter after writing.
+
 2003-07-22  Gonzalo Paniagua Javier <[email protected]>
 
 	* HttpWriter.cs: avoid duplicating the MemoryStream byte buffer.

+ 46 - 48
mcs/class/System.Web/System.Web/HttpResponseStreamProxy.cs

@@ -1,48 +1,46 @@
-// 
-// System.Web.HttpResponseStreamProxy
-//
-// Author:
-//   Patrik Torstensson ([email protected])
-//
-using System;
-using System.IO;
-
-namespace System.Web {
-   /// <summary>
-   /// Used to detect if there is a valid filter proxy.
-   /// </summary>
-   class HttpResponseStreamProxy : HttpResponseStream {
-      bool _FilteringActive;
-	   
-      internal HttpResponseStreamProxy(HttpWriter Writer) : base(Writer) {
-         _FilteringActive = false;
-      }
-		
-      internal void CheckFilteringState() {
-         if (_FilteringActive) {
-            throw new HttpException("Invalid response filter state");
-         }
-      }
-		
-      internal bool Active {
-         get {
-            return _FilteringActive;
-         }
-         set {
-            _FilteringActive = value;
-         }
-      }
-		
-      public override void Flush() {
-      }
-
-      public override void Close() {
-      }
-		
-      public override void Write(byte [] buffer, int offset, int length) {
-         CheckFilteringState();
-         
-         Write(buffer, offset, length);
-      }
-   }
-}
+// 
+// System.Web.HttpResponseStreamProxy
+//
+// Authors:
+// 	Patrik Torstensson ([email protected])
+//
+using System;
+using System.IO;
+
+namespace System.Web
+{
+	class HttpResponseStreamProxy : HttpResponseStream
+	{
+		bool filteringActive;
+
+		internal HttpResponseStreamProxy (HttpWriter writer) : base (writer)
+		{
+		}
+
+		internal void CheckFilteringState ()
+		{
+			if (!filteringActive)
+				throw new HttpException ("Invalid response filter state");
+		}
+
+		internal bool Active {
+			get { return filteringActive; }
+			set { filteringActive = value; }
+		}
+
+		public override void Flush ()
+		{
+		}
+
+		public override void Close ()
+		{
+		}
+
+		public override void Write (byte [] buffer, int offset, int length)
+		{
+			CheckFilteringState ();
+			base.Write (buffer, offset, length);
+		}
+	}
+}
+

+ 1 - 0
mcs/class/System.Web/System.Web/HttpWriter.cs

@@ -84,6 +84,7 @@ namespace System.Web
 			try {
 				// Call the filter (it does a callback into our HttpWriter again)
 				_OutputFilter.Write (arrData, 0, size);
+				_OutputFilter.Flush ();
 
 				if (CloseStream)
 					_OutputFilter.Close ();