Author: sebb
Date: Fri Nov 16 10:44:25 2007
New Revision: 595772
URL: http://svn.apache.org/viewvc?rev=595772&view=rev
Log:
Don't assume port is 80 if not specified (may be https e.g. spoofing)
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
Modified:
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
URL:
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java?rev=595772&r1=595771&r2=595772&view=diff
==============================================================================
---
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
(original)
+++
jakarta/jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/proxy/HttpRequestHdr.java
Fri Nov 16 10:44:25 2007
@@ -465,12 +465,14 @@
return str;
}
+ // TODO replace repeated substr() above and below with more efficient
method.
+
/**
- * Find the :PORT form http://server.ect:PORT/some/file.xxx
+ * Find the :PORT from http://server.ect:PORT/some/file.xxx
*
- * @return server's port
+ * @return server's port (or UNSPECIFIED if not found)
*/
- public int serverPort() {
+ private int serverPort() {
String str = url;
// chop to "server.name:x/thing"
int i = str.indexOf("//");
@@ -487,7 +489,7 @@
if (0 < i) {
return Integer.parseInt(str.substring(i + 1).trim());
}
- return 80;
+ return HTTPSamplerBase.UNSPECIFIED_PORT;
}
/**
@@ -495,7 +497,7 @@
*
* @return the deproxied url
*/
- public String serverUrl() {
+ private String serverUrl() {
String str = url;
int i = str.indexOf("//");
if (i > 0) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]