forked from lix-project/hydra
Merge branch 'receiveContents' of https://github.com/orivej/hydra
This commit is contained in:
commit
b59a5850a8
1 changed files with 4 additions and 4 deletions
|
@ -45,15 +45,15 @@ struct Extractor : ParseSink
|
||||||
hashSink = std::make_unique<HashSink>(htSHA256);
|
hashSink = std::make_unique<HashSink>(htSHA256);
|
||||||
}
|
}
|
||||||
|
|
||||||
void receiveContents(unsigned char * data, size_t len) override
|
void receiveContents(std::string_view data) override
|
||||||
{
|
{
|
||||||
assert(expectedSize);
|
assert(expectedSize);
|
||||||
assert(curMember);
|
assert(curMember);
|
||||||
assert(hashSink);
|
assert(hashSink);
|
||||||
*curMember->fileSize += len;
|
*curMember->fileSize += data.size();
|
||||||
(*hashSink)(data, len);
|
(*hashSink)(data);
|
||||||
if (curMember->contents) {
|
if (curMember->contents) {
|
||||||
curMember->contents->append((char *) data, len);
|
curMember->contents->append(data);
|
||||||
}
|
}
|
||||||
assert(curMember->fileSize <= expectedSize);
|
assert(curMember->fileSize <= expectedSize);
|
||||||
if (curMember->fileSize == expectedSize) {
|
if (curMember->fileSize == expectedSize) {
|
||||||
|
|
Loading…
Reference in a new issue