You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jmeter.apache.org by se...@apache.org on 2014/02/22 14:33:05 UTC

svn commit: r1570839 - /jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java

Author: sebb
Date: Sat Feb 22 13:33:05 2014
New Revision: 1570839

URL: http://svn.apache.org/r1570839
Log:
ERROR - jmeter.util.JMeterUtils: Unable to get local host IP address
Reuse existing JMeterUtils code
Bugzilla Id: 56174

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java

Modified: jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java?rev=1570839&r1=1570838&r2=1570839&view=diff
==============================================================================
--- jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java (original)
+++ jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/sampler/HTTPHCAbstractImpl.java Sat Feb 22 13:33:05 2014
@@ -106,13 +106,8 @@ public abstract class HTTPHCAbstractImpl
                 log.warn(e.getLocalizedMessage());
             }
         } else {
-            try {
-                InetAddress addr = InetAddress.getLocalHost();
-                // Get hostname
-                localHostOrIP = addr.getHostName();
-            } catch (UnknownHostException e) {
-                log.warn("Cannot determine localhost name, and httpclient.localaddress was not specified");
-            }
+            // Get hostname
+            localHostOrIP = JMeterUtils.getLocalHostName();
         }
         localAddress = inet;
         localHost = localHostOrIP;