* FYI: Backport fix for PR classpath/28580 from classpath
@ 2006-09-11 18:21 David Daney
0 siblings, 0 replies; only message in thread
From: David Daney @ 2006-09-11 18:21 UTC (permalink / raw)
To: java-patches
[-- Attachment #1: Type: text/plain, Size: 139 bytes --]
As pre-authorized by Tom Tromey, and after regression testing, I have
backported the fix for PR classpath/28580 into libgcj.
David Daney
[-- Attachment #2: pr28580.d --]
[-- Type: text/plain, Size: 2432 bytes --]
Index: gnu/java/net/protocol/http/Request.java
===================================================================
--- gnu/java/net/protocol/http/Request.java (revision 116759)
+++ gnu/java/net/protocol/http/Request.java (working copy)
@@ -419,13 +419,16 @@
switch (code)
{
case 100:
+ break;
case 204:
case 205:
case 304:
+ body = createResponseBodyStream(responseHeaders, majorVersion,
+ minorVersion, in, false);
break;
default:
body = createResponseBodyStream(responseHeaders, majorVersion,
- minorVersion, in);
+ minorVersion, in, true);
}
// Construct response
@@ -453,7 +456,8 @@
private InputStream createResponseBodyStream(Headers responseHeaders,
int majorVersion,
int minorVersion,
- InputStream in)
+ InputStream in,
+ boolean mayHaveBody)
throws IOException
{
long contentLength = -1;
@@ -466,8 +470,13 @@
(majorVersion == 1 && minorVersion == 0);
String transferCoding = responseHeaders.getValue("Transfer-Encoding");
- if ("chunked".equalsIgnoreCase(transferCoding))
+ if ("HEAD".equals(method) || !mayHaveBody)
{
+ // Special case no body.
+ in = new LimitedLengthInputStream(in, 0, true, connection, doClose);
+ }
+ else if ("chunked".equalsIgnoreCase(transferCoding))
+ {
in = new LimitedLengthInputStream(in, -1, false, connection, doClose);
in = new ChunkedInputStream(in, responseHeaders);
Index: ChangeLog.gcj
===================================================================
--- ChangeLog.gcj (revision 116852)
+++ ChangeLog.gcj (working copy)
@@ -1,3 +1,11 @@
+2006-09-11 David Daney <ddaney@avtrex.com>
+
+ PR classpath/28580
+ * gnu/java/net/protocol/http/Request.java (readResponse): Call
+ createResponseBodyStream in more cases and with new parameter.
+ (createResponseBodyStream): Added new parameter mayHaveBody. Handle
+ HEAD and !mayHaveBody responses specially.
+
2006-09-05 Gary Benson <gbenson@redhat.com>
* java/net/SocketPermission.java
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-09-11 18:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-11 18:21 FYI: Backport fix for PR classpath/28580 from classpath David Daney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).