Skip to content

Commit

Permalink
[MNG-8339] An error during transfer output seems to freeze the output
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Oct 23, 2024
1 parent 3425b4d commit 3cadd20
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,9 @@ public void transferProgressed(TransferEvent event) throws TransferCancelledExce
Iterator<TransferResourceAndSize> entries = transfers.values().iterator();
while (entries.hasNext()) {
TransferResourceAndSize entry = entries.next();
long total = entry.resource.getContentLength();
Long complete = entry.transferredBytes;
// just in case, make sure 0 <= complete <= total
long complete = Math.max(0, entry.transferredBytes);
long total = Math.max(complete, entry.resource.getContentLength());

String resourceName = entry.resource.getResourceName();

Expand Down

0 comments on commit 3cadd20

Please sign in to comment.