From 93d366516a2ee1e3816a458cc3e501c404e83d76 Mon Sep 17 00:00:00 2001 From: Mike Goslin Date: Thu, 9 Nov 2000 05:12:27 +0000 Subject: [PATCH] *** empty log message *** --- panda/src/downloader/downloader.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/downloader/downloader.cxx b/panda/src/downloader/downloader.cxx index 775cfe92d7..0bce9d5552 100644 --- a/panda/src/downloader/downloader.cxx +++ b/panda/src/downloader/downloader.cxx @@ -91,6 +91,8 @@ init(PT(Buffer) buffer) { _token_board = new DownloaderTokenBoard; _buffer = buffer; _download_enabled = true; + // We need to flush after every write in case we're interrupted + _dest_stream.setf(ios::unitbuf, 0); #if defined(WIN32) WSAData mydata; @@ -676,8 +678,6 @@ write_to_disk(DownloadStatus &status) { << status._bytes_in_buffer << " to disk" << endl; _dest_stream.write(status._start, status._bytes_in_buffer); - // We need to explicitly flush in case we're interrupted - _dest_stream.flush(); status._total_bytes_written += status._bytes_in_buffer; // Throw an event to indicate how many bytes have been written so far