Explorar o código

Fix regression 100% CPU utility when -V is used and download is multi-file BT

This is regression of a3426821c8a7f9cf8d80a81726157d4eb844f661
Tatsuhiro Tsujikawa %!s(int64=11) %!d(string=hai) anos
pai
achega
d69764879e
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      src/MultiDiskAdaptor.cc

+ 4 - 0
src/MultiDiskAdaptor.cc

@@ -394,6 +394,10 @@ ssize_t MultiDiskAdaptor::readData
       auto nread = (*i)->getDiskWriter()->readData(data+(len-rem),
                                                    readLength, fileOffset);
 
+      if(nread == 0) {
+        return totalReadLength;
+      }
+
       totalReadLength += nread;
 
       if(dropCache) {