1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 14:51:16 +02:00

serialise: fix buffer size used, hide method for internal use only

Fixes #2169.
This commit is contained in:
Will Dietz 2018-05-21 17:26:41 -05:00
parent 966407bcf1
commit b08923b4a0
3 changed files with 9 additions and 5 deletions

View file

@ -77,10 +77,12 @@ struct BufferedSource : Source
size_t read(unsigned char * data, size_t len) override;
/* Underlying read call, to be overridden. */
virtual size_t readUnbuffered(unsigned char * data, size_t len) = 0;
bool hasData();
protected:
/* Underlying read call, to be overridden. */
virtual size_t readUnbuffered(unsigned char * data, size_t len) = 0;
};
@ -134,8 +136,9 @@ struct FdSource : BufferedSource
return *this;
}
size_t readUnbuffered(unsigned char * data, size_t len) override;
bool good() override;
protected:
size_t readUnbuffered(unsigned char * data, size_t len) override;
private:
bool _good = true;
};