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 sn...@apache.org on 2002/11/18 18:55:54 UTC
cvs commit: xml-soap/java/src/org/apache/soap/util/net HTTPUtils.java
snichol 2002/11/18 09:55:54
Modified: java/src/org/apache/soap/util/net HTTPUtils.java
Log:
Fix bug parsing HTTP status line discovered in interop tests with SIM.
Also, throw an exception if there is no HTTP status.
Revision Changes Path
1.37 +8 -1 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.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- HTTPUtils.java 12 Nov 2002 14:15:38 -0000 1.36
+++ HTTPUtils.java 18 Nov 2002 17:55:54 -0000 1.37
@@ -532,9 +532,16 @@
}
if (b == -1)
throw new Exception("Reached end of stream while reading HTTP response status");
+ if (codeStart == -1)
+ throw new Exception("HTTP response status not present");
versionString = new String(linebuf, 0, versionEnd, ISO_8859_1);
+ if (codeEnd == -1)
+ codeEnd = count + 1;
statusCode = Integer.parseInt(new String(linebuf, codeStart, codeEnd - codeStart, ISO_8859_1));
- statusString = new String(linebuf, stringStart, count - stringStart, ISO_8859_1);
+ if (stringStart != -1)
+ statusString = new String(linebuf, stringStart, 1 + count - stringStart, ISO_8859_1);
+ else
+ statusString = "";
} catch (Exception e) {
throw new SOAPException(Constants.FAULT_CODE_CLIENT,
"Error parsing HTTP status line \"" + new String(linebuf, 0, count, ISO_8859_1) + "\": " + e, e);