From 5bf4c6a635d30ba2e209fa9a2f824e06a6fa479b Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 6 Jul 2010 13:59:12 +0000 Subject: [PATCH] * io.c (nogvl_copy_stream_sendfile): jump to retry_sendfile directly to avoid select() on a socket which TCP state is CLOSED. patch by Eric Wong. [ruby-core:31053] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ io.c | 3 +-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19941b8869..eeef38a33f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 6 22:57:21 2010 Tanaka Akira + + * io.c (nogvl_copy_stream_sendfile): jump to retry_sendfile directly + to avoid select() on a socket which TCP state is CLOSED. + patch by Eric Wong. [ruby-core:31053] + Tue Jul 6 21:45:34 2010 NAKAMURA Usaku * io/console/console.c (winsize_row): should return actual screen diff --git a/io.c b/io.c index 5129a143aa..4e239f8601 100644 --- a/io.c +++ b/io.c @@ -8147,8 +8147,7 @@ nogvl_copy_stream_sendfile(struct copy_stream_struct *stp) stp->total += ss; copy_length -= ss; if (0 < copy_length) { - ss = -1; - errno = EAGAIN; + goto retry_sendfile; } } if (ss == -1) {