mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
File extraction: use fseek
In the past, we allocated a buffer with zeroes and wrote that with fwrite. Now, instead we just fseek to the correct offset. This changes the way in which the file extract limit is counted a bit; skipped bytes do no longer count against the file size limit. (cherry picked from commit 5071592e9b7105090a1d9de19689c499070749d4)
This commit is contained in:
parent
5934e143aa
commit
9928f7efb7
3 changed files with 29 additions and 26 deletions
|
@ -72,8 +72,8 @@ protected:
|
|||
private:
|
||||
std::string filename;
|
||||
FILE* file_stream;
|
||||
uint64_t limit;
|
||||
uint64_t depth;
|
||||
uint64_t limit; // the file extraction limit
|
||||
uint64_t written; // how many bytes we have written so far
|
||||
};
|
||||
|
||||
} // namespace zeek::file_analysis::detail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue