X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2FHTTP.java;h=e79af03d13c6262093b2fb0193a74b87ee92789f;hb=3afe57f92ab89e920ce9d1fd6e82b76507b9a96b;hp=22a07611e7777ca5bc9a99e6b09e42c9b0855ccf;hpb=0de5728b6e6f6a7ef7090b21adbf467f21ce12f4;p=org.ibex.core.git diff --git a/src/org/xwt/HTTP.java b/src/org/xwt/HTTP.java index 22a0761..e79af03 100644 --- a/src/org/xwt/HTTP.java +++ b/src/org/xwt/HTTP.java @@ -505,7 +505,12 @@ public class HTTP { public int read(byte[] b, int off, int len) throws IOException { boolean good = false; try { - if (length == 0 && contentLength == -1) readChunk(); + if (length == 0 && contentLength == -1) { + readChunk(); + if (chunkedDone) return -1; + } else { + if (length == 0) return -1; + } if (len > length) len = length; int ret = super.read(b, off, len); length -= ret;