Răsfoiți Sursa

*** empty log message ***

Mike Goslin 25 ani în urmă
părinte
comite
e56b75d5f0

+ 4 - 2
panda/src/downloader/downloader.I

@@ -91,8 +91,10 @@ get_bytes_written(void) const {
       << "initiated" << endl;
     return 0.0;
   }
-  nassertr(_current_status != NULL, 0);
-  return _current_status->_total_bytes_written;
+  if (_current_status != NULL)
+    return _current_status->_total_bytes_written;
+  else
+    return _total_bytes_written;
 }
 
 ////////////////////////////////////////////////////////////////////

+ 2 - 0
panda/src/downloader/downloader.cxx

@@ -68,6 +68,7 @@ Downloader(void) {
   _initiated = false;
   _ever_initiated = false;
   _TCP_stack_initialized = false;
+  _total_bytes_written = 0;
 }
 
 ////////////////////////////////////////////////////////////////////
@@ -383,6 +384,7 @@ cleanup(void) {
   // connection when the download is complete
   _connected = false;
   _dest_stream.close();
+  _total_bytes_written = _current_status->_total_bytes_written;
   delete _current_status;
   _initiated = false;
 }

+ 1 - 0
panda/src/downloader/downloader.h

@@ -147,6 +147,7 @@ private:
 
   DownloadStatus *_current_status;
   bool _got_any_data;
+  int _total_bytes_written;
 
   double _tlast;
   double _tfirst;