asan target, Reset() methods, fix EAGAIN handling

This commit is contained in:
flamingcow
2019-05-07 22:54:50 -07:00
parent acc75058c6
commit fa20ad9d29
4 changed files with 26 additions and 2 deletions

View File

@@ -18,6 +18,8 @@ class ConstBuffer {
void ResetRead(); // next read from last commit
void Commit(); // commit read position
virtual void Reset(); // full reset
protected:
const char *const_buf_;
size_t len_;
@@ -33,10 +35,12 @@ class Buffer : public ConstBuffer {
[[nodiscard]] char *WritePtr();
[[nodiscard]] size_t WriteMaxLen() const;
bool Write(const std::string_view& str);
void Wrote(size_t len);
void Wrote(ssize_t len);
void Consume(); // discard up to last commit
void Reset() override; // full reset
protected:
std::unique_ptr<char[]> own_buf_;
char *buf_;