mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Fix ZeroCopyOutputStream:
Added a destructor that commits the last block of data if there was no final call to BackUp.
This commit is contained in:
@@ -152,6 +152,8 @@ public:
|
||||
ZeroCopyOutputStream (Streambuf& streambuf,
|
||||
std::size_t blockSize);
|
||||
|
||||
~ZeroCopyOutputStream();
|
||||
|
||||
bool
|
||||
Next (void** data, int* size) override;
|
||||
|
||||
@@ -177,6 +179,13 @@ ZeroCopyOutputStream<Streambuf>::ZeroCopyOutputStream(
|
||||
{
|
||||
}
|
||||
|
||||
template <class Streambuf>
|
||||
ZeroCopyOutputStream<Streambuf>::~ZeroCopyOutputStream()
|
||||
{
|
||||
if (commit_ != 0)
|
||||
streambuf_.commit(commit_);
|
||||
}
|
||||
|
||||
template <class Streambuf>
|
||||
bool
|
||||
ZeroCopyOutputStream<Streambuf>::Next(
|
||||
|
||||
Reference in New Issue
Block a user