From 52ec5be1ba9768499b948186589c1404ccc64724 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Jun 2010 20:27:36 +0000 Subject: [PATCH] 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 | 2 +- GNUmakefile | 2 +- lib/io/splice.rb | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 0550f7e..671d859 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v2.0.0.GIT +DEF_VER=v2.1.0.GIT LF=' ' diff --git a/GNUmakefile b/GNUmakefile index 9b22bc4..1c6669e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -51,7 +51,7 @@ NEWS: GIT-VERSION-FILE $(RAKE) -s news_rdoc > $@+ mv $@+ $@ -SINCE = +SINCE = 1.0.0 ChangeLog: LOG_VERSION = \ $(shell git rev-parse -q "$(GIT_VERSION)" >/dev/null 2>&1 && \ echo $(GIT_VERSION) || git describe) diff --git a/lib/io/splice.rb b/lib/io/splice.rb index 227d63c..d60a24d 100644 --- a/lib/io/splice.rb +++ b/lib/io/splice.rb @@ -5,8 +5,8 @@ class IO module Splice - # the version of IO::Splice, currently 2.0.0 - VERSION = '2.0.0' + # the version of IO::Splice, currently 2.1.0 + VERSION = '2.1.0' # The maximum default capacity of the pipe in bytes. # Under stock Linux, this is 65536 bytes as of 2.6.11, and 4096 before -- 2.11.4.GIT