*** empty log message ***

This commit is contained in:
Mike Goslin 2001-07-04 01:18:37 +00:00
parent f77ea1feca
commit dea8d34556
3 changed files with 30 additions and 0 deletions

View File

@ -110,6 +110,25 @@ get_bytes_written(void) const {
return _total_bytes_written;
}
////////////////////////////////////////////////////////////////////
// Function: Downloader::get_bytes_requested
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
INLINE int Downloader::
get_bytes_requested(void) const {
if (_ever_initiated == false) {
downloader_cat.warning()
<< "Downloader::get_bytes_requested() - Download has not been "
<< "initiated" << endl;
return 0;
}
if (_current_status != NULL)
return _current_status->_total_bytes_requested;
else
return _total_bytes_requested;
}
////////////////////////////////////////////////////////////////////
// Function: Downloader::get_bytes_per_second
// Access: Public

View File

@ -67,6 +67,8 @@ Downloader(void) {
_ever_initiated = false;
_TCP_stack_initialized = false;
_total_bytes_written = 0;
_total_bytes_requested = 0;
_total_bytes_requested = 0;
}
////////////////////////////////////////////////////////////////////
@ -433,6 +435,7 @@ cleanup(void) {
disconnect_from_server();
_dest_stream.close();
_total_bytes_written = _current_status->_total_bytes_written;
_total_bytes_requested = _current_status->_total_bytes_requested;
delete _current_status;
// We must set this to NULL otherwise there is a bad pointer floating around
_current_status = NULL;
@ -543,6 +546,8 @@ run(void) {
fret = fast_receive(_socket, _current_status, _receive_size);
}
_current_status->_total_bytes_requested += _receive_size;
// Check for end of file
if (fret == EU_eof) {
if (_got_any_data == true) {
@ -664,6 +669,8 @@ run_to_ram(void) {
fret = fast_receive(_socket, _current_status, _receive_size);
}
_current_status->_total_bytes_requested += _receive_size;
// Check for end of file
if (fret == EU_eof) {
if (_got_any_data == true) {
@ -1003,6 +1010,7 @@ DownloadStatus(char *buffer, int first_byte, int last_byte,
// will get the total size of the file, not just the number
// of bytes for this partial download
_total_bytes_written = first_byte;
_total_bytes_requested = first_byte;
_partial_content = partial_content;
reset();
}

View File

@ -65,6 +65,7 @@ PUBLISHED:
INLINE void set_disk_write_frequency(int frequency);
INLINE int get_disk_write_frequency(void) const;
INLINE int get_bytes_written(void) const;
INLINE int get_bytes_requested(void) const;
INLINE float get_bytes_per_second(void) const;
private:
@ -82,6 +83,7 @@ private:
char *_next_in;
int _bytes_in_buffer;
int _total_bytes_written;
int _total_bytes_requested;
int _first_byte;
int _last_byte;
int _total_bytes;
@ -124,6 +126,7 @@ private:
DownloadStatus *_current_status;
bool _got_any_data;
int _total_bytes_written;
int _total_bytes_requested;
bool _download_to_ram;
double _tlast;