Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
smarek committed Oct 4, 2014
2 parents 15edc87 + 31049cf commit b954a31
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ byte[] getResponseData(HttpEntity entity) throws IOException {
ByteArrayBuffer buffer = new ByteArrayBuffer((int) contentLength);
try {
byte[] tmp = new byte[BUFFER_SIZE];
int l;
int l, count = 0;
// do not send messages if request has been cancelled
while ((l = instream.read(tmp)) != -1 && !Thread.currentThread().isInterrupted()) {
buffer.append(tmp, 0, l);
sendProgressDataMessage(copyOfRange(tmp, 0, l));
sendProgressMessage(count, (int) contentLength);
}
} finally {
AsyncHttpClient.silentCloseInputStream(instream);
Expand Down

0 comments on commit b954a31

Please sign in to comment.