ASF Bugzilla – Attachment 21036 Details for
Bug 43588
Tomcat uses hardcoded 127.0.0.1 for localhost
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Revised patch. Please review / vote.
tomcat-43588-patch.txt (text/plain), 5.19 KB, created by
Paul Shemansky
on 2007-10-24 08:58:34 UTC
(
hide
)
Description:
Revised patch. Please review / vote.
Filename:
MIME Type:
Creator:
Paul Shemansky
Created:
2007-10-24 08:58:34 UTC
Size:
5.19 KB
patch
obsolete
>Index: java/org/apache/tomcat/util/net/BaseEndpoint.java >=================================================================== >--- java/org/apache/tomcat/util/net/BaseEndpoint.java (revision 587540) >+++ java/org/apache/tomcat/util/net/BaseEndpoint.java (working copy) >@@ -332,7 +332,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.getLocalHost().getHostAddress(), port); > } else { > s = new java.net.Socket(address, port); > // setting soLinger to a small value will help shutdown the >Index: java/org/apache/tomcat/util/net/PoolTcpEndpoint.java >=================================================================== >--- java/org/apache/tomcat/util/net/PoolTcpEndpoint.java (revision 587540) >+++ java/org/apache/tomcat/util/net/PoolTcpEndpoint.java (working copy) >@@ -372,7 +372,7 @@ > try { > // Need to create a connection to unlock the accept(); > if (inet == null) { >- s = new Socket("127.0.0.1", port); >+ s = new Socket(InetAddress.getLocalHost().getHostAddress(), port); > } else { > s = new Socket(inet, port); > // setting soLinger to a small value will help shutdown the >Index: java/org/apache/tomcat/util/net/JIoEndpoint.java >=================================================================== >--- java/org/apache/tomcat/util/net/JIoEndpoint.java (revision 587540) >+++ java/org/apache/tomcat/util/net/JIoEndpoint.java (working copy) >@@ -581,7 +581,7 @@ > try { > // Need to create a connection to unlock the accept(); > if (address == null) { >- s = new Socket("127.0.0.1", port); >+ s = new Socket(InetAddress.getLocalHost().getHostAddress(), port); > } else { > s = new Socket(address, port); > // setting soLinger to a small value will help shutdown the >Index: java/org/apache/tomcat/util/net/AprEndpoint.java >=================================================================== >--- java/org/apache/tomcat/util/net/AprEndpoint.java (revision 587540) >+++ java/org/apache/tomcat/util/net/AprEndpoint.java (working copy) >@@ -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.getLocalHost().getHostAddress(), port); > } else { > s = new java.net.Socket(address, port); > // setting soLinger to a small value will help shutdown the >Index: java/org/apache/catalina/core/StandardServer.java >=================================================================== >--- java/org/apache/catalina/core/StandardServer.java (revision 587540) >+++ java/org/apache/catalina/core/StandardServer.java (working copy) >@@ -372,7 +372,7 @@ > try { > serverSocket = > new ServerSocket(port, 1, >- InetAddress.getByName("127.0.0.1")); >+ InetAddress.getLocalHost()); > } catch (IOException e) { > log.error("StandardServer.await: create[" + port > + "]: ", e); >Index: java/org/apache/catalina/startup/Catalina.java >=================================================================== >--- java/org/apache/catalina/startup/Catalina.java (revision 587540) >+++ java/org/apache/catalina/startup/Catalina.java (working copy) >@@ -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.getLocalHost().getHostAddress(); >+ Socket socket = new Socket(hostAddress, server.getPort()); > OutputStream stream = socket.getOutputStream(); > String shutdown = server.getShutdown(); > for (int i = 0; i < shutdown.length(); i++) >Index: res/tomcat.nsi >=================================================================== >--- res/tomcat.nsi (revision 587540) >+++ res/tomcat.nsi (working copy) >@@ -242,18 +242,18 @@ > "http://tomcat.apache.org/" > > CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Welcome.lnk" \ >- "http://127.0.0.1:$R0/" >+ "http://localhost:$R0/" > > ; IfFileExists "$INSTDIR\webapps\admin" 0 NoAdminApp > ; > ; CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Administration.lnk" \ >-; "http://127.0.0.1:$R0/admin/" >+; "http://localhost:$R0/admin/" > ;NoAdminApp: > > IfFileExists "$INSTDIR\webapps\manager" 0 NoManagerApp > > CreateShortCut "$SMPROGRAMS\Apache Tomcat 6.0\Tomcat Manager.lnk" \ >- "http://127.0.0.1:$R0/manager/html" >+ "http://localhost:$R0/manager/html" > > NoManagerApp: >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 43588
:
20989
|
21036
|
21039