diff --git a/MUNGA/SPOOLER.cpp b/MUNGA/SPOOLER.cpp index 0d90faf..90a708c 100644 --- a/MUNGA/SPOOLER.cpp +++ b/MUNGA/SPOOLER.cpp @@ -352,12 +352,18 @@ void newtime.tm_hour, newtime.tm_min, newtime.tm_sec ); + // + // Read the size BEFORE saving: SaveAs rewinds the stream when it is + // done, so asking afterwards reports nothing written at all - which + // is what the first recording's log said, next to a 2.8MB file. + // + size_t written = spool->GetBytesUsed(); + spool->SaveAs(filename); CopyFileA(filename, "last.spl", FALSE); DEBUG_STREAM << "Record: wrote " << filename << " - " - << packetsRecorded << " packets, " - << (spool->GetBytesUsed() / 1024) << "KB" + << packetsRecorded << " packets, " << (written / 1024) << "KB" << (full ? " (truncated - buffer filled)" : "") << "\n" << std::flush; }