tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kkoli...@apache.org
Subject svn commit: r950682 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
Date Wed, 02 Jun 2010 17:34:55 GMT
Author: kkolinko
Date: Wed Jun  2 17:34:55 2010
New Revision: 950682

URL: http://svn.apache.org/viewvc?rev=950682&view=rev
Log:
Followup to r948043 that was a fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=49095
We should not use PrintWriter(OutputStream), because that implicitly uses the platform default
charset. Specify the charset explicitly.

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=950682&r1=950681&r2=950682&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Wed Jun  2 17:34:55 2010
@@ -17,7 +17,7 @@
 
 package org.apache.tomcat.util.net;
 
-import java.io.PrintWriter;
+import java.io.OutputStreamWriter;
 import java.net.InetSocketAddress;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -607,12 +607,12 @@ public class AprEndpoint extends Abstrac
              * BSD accept filters. The Acceptor will discard it.
              */
             if (deferAccept) {
-                PrintWriter pw;
+                OutputStreamWriter sw;
 
-                pw = new PrintWriter(s.getOutputStream());
-                pw.print("OPTIONS * HTTP/1.0\r\n" +
+                sw = new OutputStreamWriter(s.getOutputStream(), "ISO-8859-1");
+                sw.write("OPTIONS * HTTP/1.0\r\n" +
                          "User-Agent: Tomcat wakeup connection\r\n\r\n");
-                pw.flush();
+                sw.flush();
             }
             if (log.isDebugEnabled()) {
                 log.debug("Socket unlock completed for:"+saddr);



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message