Author: mhabersack
Date: 2007-01-05 16:29:24 -0500 (Fri, 05 Jan 2007)
New Revision: 70560

Modified:
   trunk/xsp/ChangeLog
   trunk/xsp/src/Mono.WebServer/MonoWorkerRequest.cs
   trunk/xsp/src/Mono.WebServer/XSPWorkerRequest.cs
Log:
Implement output header encoding support

Modified: trunk/xsp/ChangeLog
===================================================================
--- trunk/xsp/ChangeLog 2007-01-05 21:27:01 UTC (rev 70559)
+++ trunk/xsp/ChangeLog 2007-01-05 21:29:24 UTC (rev 70560)
@@ -1,3 +1,11 @@
+2007-01-05  Marek Habersack  <[EMAIL PROTECTED]>
+
+       * src/Mono.WebServer/XSPWorkerRequest.cs: use the configured
+       header encoding when outputting the headers.
+
+       * src/Mono.WebServer/MonoWorkerRequest.cs: implement support for
+       response header encoding.
+
 2006-12-23 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
 
        * src/Mono.WebServer/ApplicationServer.cs: set the server as stopped

Modified: trunk/xsp/src/Mono.WebServer/MonoWorkerRequest.cs
===================================================================
--- trunk/xsp/src/Mono.WebServer/MonoWorkerRequest.cs   2007-01-05 21:27:01 UTC 
(rev 70559)
+++ trunk/xsp/src/Mono.WebServer/MonoWorkerRequest.cs   2007-01-05 21:29:24 UTC 
(rev 70560)
@@ -83,6 +83,7 @@
        {
                IApplicationHost appHostBase;
                Encoding encoding;
+               Encoding headerEncoding;
                byte [] queryStringBytes;
                string hostVPath;
                string hostPath;
@@ -135,6 +136,24 @@
                        set { encoding = value; }
                }
 
+               protected virtual Encoding HeaderEncoding {
+                       get {
+#if NET_2_0
+                               if (headerEncoding == null) {
+                                       Encoding enc = 
HttpContext.Current.Response.HeaderEncoding;
+                                       if (enc != null)
+                                               headerEncoding = enc;
+                                       else
+                                               headerEncoding = this.Encoding;
+                               }
+                               return headerEncoding;
+                                       
+#else
+                               return this.Encoding;
+#endif
+                       }
+               }
+
                public override string GetAppPath ()
                {
                        return HostVPath;

Modified: trunk/xsp/src/Mono.WebServer/XSPWorkerRequest.cs
===================================================================
--- trunk/xsp/src/Mono.WebServer/XSPWorkerRequest.cs    2007-01-05 21:27:01 UTC 
(rev 70559)
+++ trunk/xsp/src/Mono.WebServer/XSPWorkerRequest.cs    2007-01-05 21:29:24 UTC 
(rev 70560)
@@ -340,7 +340,7 @@
                        }
 
                        responseHeaders.Append ("\r\n");
-                       return Encoding.GetBytes (responseHeaders.ToString ());
+                       return HeaderEncoding.GetBytes 
(responseHeaders.ToString ());
                }
 
                public override void FlushResponse (bool finalFlush)

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

Reply via email to