You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by gd...@locus.apache.org on 2000/10/23 21:55:39 UTC
cvs commit: xml-soap/java/src/org/apache/soap/util/net HTTPUtils.java
gdaniels 00/10/23 12:55:37
Modified: java/src/org/apache/soap/util/net HTTPUtils.java
Log:
Fix bug : If we got -1 from url.getPort(), remember that all the
way through the post() function. This avoids a problem using the
Apache web server.
Submitted by : Bhavin Parikh (bhavin_parikh@spectramarketing.com)
Revision Changes Path
1.7 +3 -3 xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java
Index: HTTPUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- HTTPUtils.java 2000/09/18 15:12:09 1.6
+++ HTTPUtils.java 2000/10/23 19:55:35 1.7
@@ -112,8 +112,9 @@
throws IllegalArgumentException {
PrintWriter out = null;
BufferedReader in = null;
+ int port;
try {
- int port = url.getPort ();
+ port = url.getPort ();
if (port < 0) // No port given..use HTTP default which is pry 80 :-)
port = HTTP_DEFAULT_PORT;
@@ -130,8 +131,7 @@
/* send it out */
out.print (HTTP_POST + " " + url.getFile() + " HTTP/" + HTTP_VERSION +
"\r\n");
- out.print (HEADER_HOST + ": " + url.getHost () + ':' + url.getPort () +
- "\r\n");
+ out.print (HEADER_HOST + ": " + url.getHost () + ':' + port + "\r\n");
out.print (HEADER_CONTENT_TYPE + ": " + contentType + "\r\n");
out.print (HEADER_CONTENT_LENGTH + ": " + content.length () + "\r\n");
for (Enumeration e = headers.keys (); e.hasMoreElements (); ) {