mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
revert unintended checkin
This commit is contained in:
parent
c947b4ba4b
commit
d0f0aeaf16
@ -32,12 +32,11 @@ get_url() const {
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
inline double P3DDownload::
|
inline double P3DDownload::
|
||||||
get_download_progress() const {
|
get_download_progress() const {
|
||||||
int total_expected_data = max(_total_server_expected_data, _total_client_expected_data);
|
if (_total_expected_data == 0) {
|
||||||
if (total_expected_data == 0) {
|
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (double)_total_data / (double)total_expected_data;
|
return (double)_total_data / (double)_total_expected_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
|
@ -24,8 +24,7 @@ P3DDownload() {
|
|||||||
_status = P3D_RC_in_progress;
|
_status = P3D_RC_in_progress;
|
||||||
_http_status_code = 0;
|
_http_status_code = 0;
|
||||||
_total_data = 0;
|
_total_data = 0;
|
||||||
_total_client_expected_data = 0;
|
_total_expected_data = 0;
|
||||||
_total_server_expected_data = 0;
|
|
||||||
_last_reported_time = 0;
|
_last_reported_time = 0;
|
||||||
|
|
||||||
_canceled = false;
|
_canceled = false;
|
||||||
@ -40,12 +39,11 @@ P3DDownload() {
|
|||||||
P3DDownload::
|
P3DDownload::
|
||||||
P3DDownload(const P3DDownload ©) :
|
P3DDownload(const P3DDownload ©) :
|
||||||
_url(copy._url),
|
_url(copy._url),
|
||||||
_total_client_expected_data(copy._total_client_expected_data)
|
_total_expected_data(copy._total_expected_data)
|
||||||
{
|
{
|
||||||
_status = P3D_RC_in_progress;
|
_status = P3D_RC_in_progress;
|
||||||
_http_status_code = 0;
|
_http_status_code = 0;
|
||||||
_total_data = 0;
|
_total_data = 0;
|
||||||
_total_server_expected_data = 0;
|
|
||||||
_last_reported_time = 0;
|
_last_reported_time = 0;
|
||||||
|
|
||||||
_canceled = false;
|
_canceled = false;
|
||||||
@ -117,7 +115,7 @@ feed_url_stream(P3D_result_code result_code,
|
|||||||
_total_data += this_data_size;
|
_total_data += this_data_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
_total_server_expected_data = max(total_expected_data, _total_data);
|
_total_expected_data = max(total_expected_data, _total_data);
|
||||||
|
|
||||||
download_progress();
|
download_progress();
|
||||||
|
|
||||||
|
@ -66,8 +66,7 @@ protected:
|
|||||||
int _http_status_code;
|
int _http_status_code;
|
||||||
|
|
||||||
size_t _total_data;
|
size_t _total_data;
|
||||||
size_t _total_client_expected_data;
|
size_t _total_expected_data;
|
||||||
size_t _total_server_expected_data;
|
|
||||||
time_t _last_reported_time;
|
time_t _last_reported_time;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -1080,7 +1080,6 @@ Download(P3DPackage *package, DownloadType dtype, const FileSpec &file_spec) :
|
|||||||
_dtype(dtype),
|
_dtype(dtype),
|
||||||
_file_spec(file_spec)
|
_file_spec(file_spec)
|
||||||
{
|
{
|
||||||
_total_client_expected_data = _file_spec.get_size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -1096,7 +1095,6 @@ Download(const P3DPackage::Download ©) :
|
|||||||
_dtype(copy._dtype),
|
_dtype(copy._dtype),
|
||||||
_file_spec(copy._file_spec)
|
_file_spec(copy._file_spec)
|
||||||
{
|
{
|
||||||
_total_client_expected_data = _file_spec.get_size();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
@ -1106,9 +1104,6 @@ Download(const P3DPackage::Download ©) :
|
|||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
void P3DPackage::Download::
|
void P3DPackage::Download::
|
||||||
download_progress() {
|
download_progress() {
|
||||||
nout << "download_progress " << get_url() << ": " << _total_data
|
|
||||||
<< " of " << _total_server_expected_data << " and "
|
|
||||||
<< _total_client_expected_data << "\n";
|
|
||||||
P3DFileDownload::download_progress();
|
P3DFileDownload::download_progress();
|
||||||
assert(_package->_active_download == this);
|
assert(_package->_active_download == this);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user