Make it so that drivenengine never changes (only appends) output bytes.
This commit is contained in:
@@ -352,7 +352,7 @@ std::string StreamBuffer::read_string_limit(int64_t max_allowed) {
|
||||
|
||||
std::string StreamBuffer::read_entire_contents() {
|
||||
std::string result(read_cursor_, fill());
|
||||
clear();
|
||||
read_cursor_ = write_cursor_;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -438,6 +438,11 @@ void StreamBuffer::copy_into(StreamBuffer *sb) {
|
||||
sb->write_bytes(read_cursor_, write_cursor_ - read_cursor_);
|
||||
}
|
||||
|
||||
void StreamBuffer::transfer_into(StreamBuffer *sb) {
|
||||
sb->write_bytes(read_cursor_, write_cursor_ - read_cursor_);
|
||||
read_cursor_ = write_cursor_;
|
||||
}
|
||||
|
||||
bool StreamBuffer::contents_equal(const StreamBuffer *other) const {
|
||||
int64_t len = fill();
|
||||
if (len != other->fill()) {
|
||||
|
||||
Reference in New Issue
Block a user