Re: svn commit: r596761 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ java/org/apache/tomcat/util/net/ res/
Filip Hanik - Dev Lists wrote: > jean-frederic clere wrote: >> [EMAIL PROTECTED] wrote: >> >>> Author: jim >>> Date: Tue Nov 20 10:19:00 2007 >>> New Revision: 596761 >>> >>> URL: http://svn.apache.org/viewvc?rev=596761&view=rev >>> Log: >>> Fix BZ 43588 - hard coded 127.0.0.1 for localhost >>> >>> Modified: >>> tomcat/tc6.0.x/trunk/STATUS.txt >>> >>> tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java >>> tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java >>> >>> tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java >>> >>> tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java >>> >>> tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java >>> >>> tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java >>> >>> tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java >>> >>> tomcat/tc6.0.x/trunk/res/tomcat.nsi >>> >>> >> >> >>> Modified: >>> tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java >>> URL: >>> http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java?rev=596761&r1=596760&r2=596761&view=diff >>> >>> == >>> >>> --- >>> tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java >>> (original) >>> +++ >>> tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java >>> Tue Nov 20 10:19:00 2007 >>> @@ -24,6 +24,7 @@ >>> import java.io.IOException; >>> import java.io.InputStream; >>> import java.io.OutputStream; >>> +import java.net.InetAddress; >>> import java.net.Socket; >>> import java.util.ArrayList; >>> import java.util.HashMap; >>> @@ -416,7 +417,8 @@ >>> >>> // Stop the existing server >>> try { >>> -Socket socket = new Socket("127.0.0.1", server.getPort()); >>> +String hostAddress = >>> InetAddress.getByName("localhost").getHostAddress(); >>> +Socket socket = new Socket(hostAddress, server.getPort()); >>> >> >> Why not using Socket socket = new Socket("localhost", >> server.getPort()); ? >> > :) save one line > there is no difference, the Socket class will do the exact same > translation. > same code will get executed Ok. I would have prefer to keep modifications to the minimum that is more easy to review patches. Cheers Jean-Frederic > Filip >> Cheers >> >> Jean-Frederic >> >> - >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r596761 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ java/org/apache/tomcat/util/net/ res/
jean-frederic clere wrote: [EMAIL PROTECTED] wrote: Author: jim Date: Tue Nov 20 10:19:00 2007 New Revision: 596761 URL: http://svn.apache.org/viewvc?rev=596761&view=rev Log: Fix BZ 43588 - hard coded 127.0.0.1 for localhost Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java tomcat/tc6.0.x/trunk/res/tomcat.nsi Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java?rev=596761&r1=596760&r2=596761&view=diff == --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java Tue Nov 20 10:19:00 2007 @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.InetAddress; import java.net.Socket; import java.util.ArrayList; import java.util.HashMap; @@ -416,7 +417,8 @@ // Stop the existing server try { -Socket socket = new Socket("127.0.0.1", server.getPort()); +String hostAddress = InetAddress.getByName("localhost").getHostAddress(); +Socket socket = new Socket(hostAddress, server.getPort()); Why not using Socket socket = new Socket("localhost", server.getPort()); ? :) save one line there is no difference, the Socket class will do the exact same translation. same code will get executed Filip Cheers Jean-Frederic - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r596761 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ java/org/apache/tomcat/util/net/ res/
[EMAIL PROTECTED] wrote: > Author: jim > Date: Tue Nov 20 10:19:00 2007 > New Revision: 596761 > > URL: http://svn.apache.org/viewvc?rev=596761&view=rev > Log: > Fix BZ 43588 - hard coded 127.0.0.1 for localhost > > Modified: > tomcat/tc6.0.x/trunk/STATUS.txt > tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java > tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java > tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java > tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java > tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java > tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java > tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java > tomcat/tc6.0.x/trunk/res/tomcat.nsi > > Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java > URL: > http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java?rev=596761&r1=596760&r2=596761&view=diff > == > --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java > (original) > +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java Tue > Nov 20 10:19:00 2007 > @@ -24,6 +24,7 @@ > import java.io.IOException; > import java.io.InputStream; > import java.io.OutputStream; > +import java.net.InetAddress; > import java.net.Socket; > import java.util.ArrayList; > import java.util.HashMap; > @@ -416,7 +417,8 @@ > > // Stop the existing server > try { > -Socket socket = new Socket("127.0.0.1", server.getPort()); > +String hostAddress = > InetAddress.getByName("localhost").getHostAddress(); > +Socket socket = new Socket(hostAddress, server.getPort()); Why not using Socket socket = new Socket("localhost", server.getPort()); ? Cheers Jean-Frederic - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: svn commit: r596761 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ java/org/apache/tomcat/util/net/ res/
[EMAIL PROTECTED] wrote: Author: jim Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=596761&r1=596760&r2=596761&view=diff == --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue Nov 20 10:19:00 2007 @@ -858,7 +858,7 @@ try { // Need to create a connection to unlock the accept(); if (address == null) { -s = new java.net.Socket("127.0.0.1", port); +s = new java.net.Socket(InetAddress.getByName("localhost").getHostAddress(), port); Although fine related to the localhost address, this will need to get changed. The problem is with IPV6 cause in case the bind address is IPV6 the unlock should be "s = new java.net.Socket("::1", port);" On some platforms APR doesn't listen on IPV4 and IPV6 like FreeBSD and Windows. It's not something related to this patch but something related to the concept itself. The best approach for unlock IMO would be to use the actual bind address, but again there is a problem with NULL for IPV4/IPV6 and the fact that we'd need to figure out the IP for each of them (localhost). Regards, Mladen - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r596761 - in /tomcat/tc6.0.x/trunk: ./ java/org/apache/catalina/core/ java/org/apache/catalina/startup/ java/org/apache/tomcat/util/net/ res/
Author: jim Date: Tue Nov 20 10:19:00 2007 New Revision: 596761 URL: http://svn.apache.org/viewvc?rev=596761&view=rev Log: Fix BZ 43588 - hard coded 127.0.0.1 for localhost Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java tomcat/tc6.0.x/trunk/res/tomcat.nsi Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=596761&r1=596760&r2=596761&view=diff == --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Tue Nov 20 10:19:00 2007 @@ -26,11 +26,6 @@ [ New proposals should be added at the end of the list ] -* Fix BZ 43588 - hard coded 127.0.0.1 for localhost - http://people.apache.org/~jim/patches/tc-localhost.txt - +1: jim, pero, fhanik - -1: - * Add tests for the cookie parsing. http://people.apache.org/~jfclere/patches/test_cookies.patch +1: jfclere Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java?rev=596761&r1=596760&r2=596761&view=diff == --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/core/StandardServer.java Tue Nov 20 10:19:00 2007 @@ -372,7 +372,7 @@ try { serverSocket = new ServerSocket(port, 1, - InetAddress.getByName("127.0.0.1")); + InetAddress.getByName("localhost").getHostAddress()); } catch (IOException e) { log.error("StandardServer.await: create[" + port + "]: ", e); Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java?rev=596761&r1=596760&r2=596761&view=diff == --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/startup/Catalina.java Tue Nov 20 10:19:00 2007 @@ -24,6 +24,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.net.InetAddress; import java.net.Socket; import java.util.ArrayList; import java.util.HashMap; @@ -416,7 +417,8 @@ // Stop the existing server try { -Socket socket = new Socket("127.0.0.1", server.getPort()); +String hostAddress = InetAddress.getByName("localhost").getHostAddress(); +Socket socket = new Socket(hostAddress, server.getPort()); OutputStream stream = socket.getOutputStream(); String shutdown = server.getShutdown(); for (int i = 0; i < shutdown.length(); i++) Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=596761&r1=596760&r2=596761&view=diff == --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue Nov 20 10:19:00 2007 @@ -858,7 +858,7 @@ try { // Need to create a connection to unlock the accept(); if (address == null) { -s = new java.net.Socket("127.0.0.1", port); +s = new java.net.Socket(InetAddress.getByName("localhost").getHostAddress(), port); } else { s = new java.net.Socket(address, port); // setting soLinger to a small value will help shutdown the Modified: tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java?rev=596761&r1=596760&r2=596761&view=diff == --- tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/tomcat/util/net/BaseEndpoint.java Tue Nov 20 10:19:00 2007 @@ -3