From fc195e2da53ed48c93cc0a91172e937190f69f9c Mon Sep 17 00:00:00 2001 From: Mike Goslin Date: Fri, 15 Dec 2000 19:13:19 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/downloader/downloader.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/panda/src/downloader/downloader.cxx b/panda/src/downloader/downloader.cxx index ce237fcc40..6f5e344663 100644 --- a/panda/src/downloader/downloader.cxx +++ b/panda/src/downloader/downloader.cxx @@ -37,6 +37,8 @@ enum FastReceiveCode { FR_no_data = -3, }; +const int MAX_RECEIVE_BYTES = 16384; + //////////////////////////////////////////////////////////////////// // Function: Downloader::Constructor // Access: Published @@ -415,7 +417,16 @@ run(void) { } // Attempt to receive the bytes from the socket - int fret = fast_receive(_socket, _current_status, _receive_size); + int repeat = 1; + if (_receive_size > MAX_RECEIVE_BYTES) { + repeat += (int)(_receive_size / MAX_RECEIVE_BYTES); + } + int fret; + for (int i = 0; i < repeat; i++) { + fret = fast_receive(_socket, _current_status, _receive_size); + if (fret == FR_eof || fret < 0) + break; + } _tlast = _clock.get_real_time(); // Check for end of file