Skip to content

Releases: djherbis/nio

Go module support

25 Apr 14:50
aee7de2
Compare
Choose a tag to compare
v3.0.1

go mod tidy

Unblocking Write

25 Jan 04:46
Compare
Choose a tag to compare

I made CloseWithError work more similarly to io.Pipe(). CloseWithError effects the error with which the other end of the pipe will return, the same side will return io.ErrClosedPipe.

Also, Close() called concurrently with a Write should cause it to unblock and return (with an error).

Previously, when Closing a concurrent Write would continue to attempt to write to the buffer until successful (leading to it blocking indefinitely if you stopped reading data off the buffer). Now if the writer is awaiting space in the buffer, and is canceled via Close(), it may or may not add the pending data to the buffer, but will return an appropriate error if it fails to add it and return promptly.

Code Coverage 100%

20 Jan 03:16
Compare
Choose a tag to compare

Simplified the code for PipeWriter.Write and increased code coverage to 100%.

Logical Race Fix

17 Jan 16:21
Compare
Choose a tag to compare

Big thanks to @danp for finding and fixing a race

toctou race between:

  • check: if a write is too large to fit in the remaining space in a buffer
  • use: write to the buffer, capping the write at the size of the gap

Since we blocked on a zero-sized gap before doing the write, it's possible that the gap could have grown larger than the write, causing us to slice the write past it's boundaries!

Exposing PipeReader & PipeWriter

29 Mar 03:32
Compare
Choose a tag to compare

Now PipeReader and PipeWriter are exposed like in io.Pipe() and CloseWithError is accessible.

Thanks to @FiloSottile for the change.

v1.0.0

11 Feb 03:11
Compare
Choose a tag to compare
adding report card & release shield