-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buffer in a tmpfile #1
Comments
|
thanks @tv42! |
buffering is a tricky issue and truly breaks the advantages of a pipeline. in practice a solid script would always check the exit code of hashpipe, regardless of the output. perhaps an option to hashpipe? |
It should be an option at the very least |
buffering the blob still does not remove the need to check the exit code in a pipeline of any consequence, so why buffer? for example, hypothtically the write of the buffered, verified data on the pipeline could fail with a partial write to the output. if hashpipe fails to digest properly simply abort with a burp to stderr and and a non-zero exit code and let the caller worry about how to harden the environment. in other words, the exit code indicates correctness as much as the output. |
yep, this is what it already does. the buffering is to avoid nuking the machine's memory. swap may work fine, but it's still unideal. (i.e. if i know im about to get 100MB exec i may want to buffer it in a file of my choosing) |
so hashpipe buffers (to temp file) the whole blob before writing to output? -j On Sat, Apr 4, 2015 at 6:01 PM, Juan Batiz-Benet [email protected]
|
it does not currently buffer to a temp file. im saying there should be an option to.
suppose the file being input is 1TB. |
@jmscott assuming @jbenet you could chunk the file, calculate a hash for each chunk and then hash the list of hashes. On start, it reads and verifies the list of hashes with argv[1] and is then able to verify and write each chunk to stdout. |
|
@jbenet I think you misread my comment. |
Never mind, noticed you've been referring to the 2nd part. |
hashpipe needs to buffer all the data as the hash isn't decidable until the last bit. we could buffer on disk with a tmpfile instead of memory.
The text was updated successfully, but these errors were encountered: