summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-23 12:52:49 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-23 12:52:49 +0000
commite6fe59e96e98d450c815970a3afe96278104b848 (patch)
tree95e9dce0efc0b042460d08fb43bef7d9fbdca57f
parent645257261e3ed388c2879f4386c4a805c0fdaeb9 (diff)
[DOC]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43022 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--io.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/io.c b/io.c
index 29b25d7..a60c17a 100644
--- a/io.c
+++ b/io.c
@@ -8565,14 +8565,17 @@ rb_io_advise(int argc, VALUE *argv, VALUE io)
* <code>write_nonblock</code> and <code>IO.select</code> as follows:
* IO::WaitReadable should also be rescued for SSL renegotiation in <code>OpenSSL::SSL::SSLSocket</code>.
*
- * begin
- * result = io_like.write_nonblock(string)
- * rescue IO::WaitReadable
- * IO.select([io_like])
- * retry
- * rescue IO::WaitWritable
- * IO.select(nil, [io_like])
- * retry
+ * while 0 < string.bytesize
+ * begin
+ * written = io_like.write_nonblock(string)
+ * rescue IO::WaitReadable
+ * IO.select([io_like])
+ * retry
+ * rescue IO::WaitWritable
+ * IO.select(nil, [io_like])
+ * retry
+ * end
+ * string = string.byteslice(written..-1)
* end
*
* === Parameters