Ruby io_splice 2.1.0 - IO::Splice.copy_stream fixesv2.1.0
commit52ec5be1ba9768499b948186589c1404ccc64724
authorEric Wong <normalperson@yhbt.net>
Sun, 6 Jun 2010 20:27:36 +0000 (6 20:27 +0000)
committerEric Wong <normalperson@yhbt.net>
Sun, 6 Jun 2010 20:27:36 +0000 (6 20:27 +0000)
tree51439a7d4f55a1215ac6c77a629b4a606f27e214
parent1db6afb8369cafdfe05680798ee68fe3081251d2
Ruby io_splice 2.1.0 - IO::Splice.copy_stream fixes

This fixes the issue with our copy_stream where non-pipe
descriptors with the O_NONBLOCK flag set were not handled
correctly.  Like IO.copy_stream in Ruby 1.9, our
IO::Splice.copy_stream will _always_ block until IO is available
(or raise if there are errors).

IO::Splice.copy_stream now closes all file descriptors that were
opened within the method, reducing pressure on the garbage
collector.

There are also new singleton convenience methods:

  * IO::Splice.full - blocks and splices the full amount
  * IO::Splice.partial - blocks until something is spliceable

  They are used internally to implement IO::Splice.copy_stream,
  but may also be useful to end users.

Rcov shows 100% test coverage \o/
GIT-VERSION-GEN
GNUmakefile
lib/io/splice.rb