summaryrefslogtreecommitdiff
path: root/lib/backupclient
diff options
context:
space:
mode:
Diffstat (limited to 'lib/backupclient')
-rw-r--r--lib/backupclient/BackupStoreFile.cpp8
-rw-r--r--lib/backupclient/BackupStoreFile.h7
-rw-r--r--lib/backupclient/BackupStoreFileEncodeStream.cpp2
-rw-r--r--lib/backupclient/BackupStoreFileEncodeStream.h2
4 files changed, 14 insertions, 5 deletions
diff --git a/lib/backupclient/BackupStoreFile.cpp b/lib/backupclient/BackupStoreFile.cpp
index 4bd75f96..44d96d0c 100644
--- a/lib/backupclient/BackupStoreFile.cpp
+++ b/lib/backupclient/BackupStoreFile.cpp
@@ -73,9 +73,11 @@ BackupStoreFileStats BackupStoreFile::msStats = {0,0,0};
// Created: 2003/08/28
//
// --------------------------------------------------------------------------
-std::auto_ptr<IOStream> BackupStoreFile::EncodeFile(const char *Filename,
- int64_t ContainerID, const BackupStoreFilename &rStoreFilename,
- int64_t *pModificationTime, ReadLoggingStream::Logger* pLogger,
+std::auto_ptr<IOStream> BackupStoreFile::EncodeFile(
+ const char *Filename, int64_t ContainerID,
+ const BackupStoreFilename &rStoreFilename,
+ int64_t *pModificationTime,
+ ReadLoggingStream::Logger* pLogger,
RunStatusProvider* pRunStatusProvider)
{
// Create the stream
diff --git a/lib/backupclient/BackupStoreFile.h b/lib/backupclient/BackupStoreFile.h
index f4c60919..f5bc1924 100644
--- a/lib/backupclient/BackupStoreFile.h
+++ b/lib/backupclient/BackupStoreFile.h
@@ -118,11 +118,14 @@ public:
// Main interface
- static std::auto_ptr<IOStream> EncodeFile(const char *Filename,
+ static std::auto_ptr<IOStream> EncodeFile
+ (
+ const char *Filename,
int64_t ContainerID, const BackupStoreFilename &rStoreFilename,
int64_t *pModificationTime = 0,
ReadLoggingStream::Logger* pLogger = NULL,
- RunStatusProvider* pRunStatusProvider = NULL);
+ RunStatusProvider* pRunStatusProvider = NULL
+ );
static std::auto_ptr<IOStream> EncodeFileDiff
(
const char *Filename, int64_t ContainerID,
diff --git a/lib/backupclient/BackupStoreFileEncodeStream.cpp b/lib/backupclient/BackupStoreFileEncodeStream.cpp
index 54c2463d..e9d773f0 100644
--- a/lib/backupclient/BackupStoreFileEncodeStream.cpp
+++ b/lib/backupclient/BackupStoreFileEncodeStream.cpp
@@ -55,6 +55,7 @@ BackupStoreFileEncodeStream::BackupStoreFileEncodeStream()
mPositionInCurrentBlock(0),
mBlockSize(BACKUP_FILE_MIN_BLOCK_SIZE),
mLastBlockSize(0),
+ mTotalBytesSent(0),
mpRawBuffer(0),
mAllocatedBufferSize(0),
mEntryIVBase(0)
@@ -463,6 +464,7 @@ int BackupStoreFileEncodeStream::Read(void *pBuffer, int NBytes, int Timeout)
// Add encoded size to stats
BackupStoreFile::msStats.mTotalFileStreamSize += (NBytes - bytesToRead);
+ mTotalBytesSent += (NBytes - bytesToRead);
// Return size of data to caller
return NBytes - bytesToRead;
diff --git a/lib/backupclient/BackupStoreFileEncodeStream.h b/lib/backupclient/BackupStoreFileEncodeStream.h
index c5fa780a..023994af 100644
--- a/lib/backupclient/BackupStoreFileEncodeStream.h
+++ b/lib/backupclient/BackupStoreFileEncodeStream.h
@@ -85,6 +85,7 @@ public:
virtual void Write(const void *pBuffer, int NBytes);
virtual bool StreamDataLeft();
virtual bool StreamClosed();
+ int64_t GetTotalBytesSent() { return mTotalBytesSent; }
private:
enum
@@ -121,6 +122,7 @@ private:
int32_t mPositionInCurrentBlock; // for reading out
int32_t mBlockSize; // Basic block size of most of the blocks in the file
int32_t mLastBlockSize; // the size (unencoded) of the last block in the file
+ int64_t mTotalBytesSent;
// Buffers
uint8_t *mpRawBuffer; // buffer for raw data
BackupStoreFile::EncodingBuffer mEncodedBuffer;