copy_stream: always use SPLICE_F_NONBLOCK for partial copy
authorEric Wong <normalperson@yhbt.net>
Tue, 17 May 2011 03:18:12 +0000 (20:18 -0700)
committerEric Wong <normalperson@yhbt.net>
Tue, 17 May 2011 21:14:26 +0000 (14:14 -0700)
commit86508cdc09ef36d8c5ae708ef9e3e19a82844e98
tree242519a48afe5d324a6c5655fdd0ac902143dd6a
parentb9cf769a639d22e63d2c611541000b46e5d07d45
copy_stream: always use SPLICE_F_NONBLOCK for partial copy

The pipe may be full from small buffers due to how TCP
works, so we need to use non-blocking I/O on the pipe.

ref: http://lkml.org/lkml/2009/1/13/478
lib/io/splice.rb
test/test_tcp_splice.rb [new file with mode: 0644]