named_pipe
named_pipe copied to clipboard
Using a zero read timeout will incorrectly consume from pipe and write to buffer
After the fix for #8 the IO will not get cancelled if using a zero timeout, consuming data from the pipe and trying to write it to a buffer that may no longer be in use. I added a test case that shows this over at https://github.com/swernli/named_pipe/commit/b1612125e241687510a94221cddd10e524fd0515
Partial output of test case:
running 1 test
thread '<unnamed>' panicked at 'assertion failed: `(left == right)`
left: `[48, 49, 50, 51, 52, 53, 54, 55, 56, 57]`,
right: `[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]`', src\lib.rs:1609:9
note: Some details are omitted, run with `RUST_BACKTRACE=full