mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 00:32:57 -04:00
*** empty log message ***
This commit is contained in:
parent
c3dbc8fbed
commit
4137f57be8
@ -78,6 +78,17 @@ get_disk_write_frequency(void) const {
|
||||
return _disk_write_frequency;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Download::get_bytes_written
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE int Download::
|
||||
get_bytes_written(void) const {
|
||||
nassertr(_current_status != NULL, 0);
|
||||
return _current_status->_total_bytes_written;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: Download::get_bytes_per_second
|
||||
// Access: Public
|
||||
@ -86,5 +97,6 @@ get_disk_write_frequency(void) const {
|
||||
INLINE float Download::
|
||||
get_bytes_per_second(void) const {
|
||||
nassertr(_tlast - _tfirst > 0.0, 0.0);
|
||||
nassertr(_current_status != NULL, 0.0);
|
||||
return (float)((double)_current_status->_total_bytes / (_tlast - _tfirst));
|
||||
}
|
||||
|
@ -361,6 +361,7 @@ run(void) {
|
||||
if (connect_to_server() == false)
|
||||
return DS_error_connect;
|
||||
|
||||
int ret = DS_ok;
|
||||
double t0 = _clock.get_real_time();
|
||||
if (_tfirst == 0.0) {
|
||||
_tfirst = t0;
|
||||
@ -376,6 +377,7 @@ run(void) {
|
||||
if (write_to_disk(_current_status) == false) {
|
||||
return DS_error_write;
|
||||
}
|
||||
ret = DS_write;
|
||||
}
|
||||
|
||||
// Allocate a new buffer
|
||||
@ -395,6 +397,7 @@ run(void) {
|
||||
<< "Download::run() - Flushing buffer" << endl;
|
||||
if (write_to_disk(_current_status) == false)
|
||||
return DS_error_write;
|
||||
ret = DS_write;
|
||||
}
|
||||
|
||||
// Attempt to receive the bytes from the socket
|
||||
@ -407,6 +410,7 @@ run(void) {
|
||||
if (_current_status->_bytes_in_buffer > 0) {
|
||||
if (write_to_disk(_current_status) == false)
|
||||
return DS_error_write;
|
||||
ret = DS_write;
|
||||
}
|
||||
return DS_success;
|
||||
} else {
|
||||
@ -420,7 +424,7 @@ run(void) {
|
||||
}
|
||||
|
||||
_got_any_data = true;
|
||||
return DS_ok;
|
||||
return ret;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
@ -58,6 +58,7 @@ PUBLISHED:
|
||||
INLINE float get_byte_rate(void) const;
|
||||
INLINE void set_disk_write_frequency(int frequency);
|
||||
INLINE int get_disk_write_frequency(void) const;
|
||||
INLINE int get_bytes_written(void) const;
|
||||
INLINE float get_bytes_per_second(void) const;
|
||||
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user