Make sure the total amount of DL/UL bytes are counted before the
transfer finalizes. Otherwise if a transfer finishes too quick, its
total numbers are not added, and results in a DL%/UL% that goes above
100%.
Detail:
progress_meter() is called periodically, and it may not catch a
transfer's total bytes if the value was unknown during the last call,
and the transfer is finished and deleted (i.e., lost) during the next
call.
Closes https://github.com/curl/curl/pull/6840
/* get the numbers before this transfer goes away */
all_dlalready += per->dlnow;
all_ulalready += per->ulnow;
+ if(!per->dltotal_added) {
+ all_dltotal += per->dltotal;
+ per->dltotal_added = TRUE;
+ }
+ if(!per->ultotal_added) {
+ all_ultotal += per->ultotal;
+ per->ultotal_added = TRUE;
+ }
}