aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-11-13 16:19:45 +0900
committerGitHub <noreply@github.com>2017-11-13 16:19:45 +0900
commitbd6add3808b6e93043b8adb9ab3866b86f8c58c5 (patch)
tree1255d5fecccbb31ad0361f8df11198d2fdc68a0c /lib
parent37106e3b97fcdab7df8cbd9d092d1cc1388506ee (diff)
parentcfa154fa577d4e4d0f551b1b3ed9502d24963ec0 (diff)
downloadruby-openssl-bd6add3808b6e93043b8adb9ab3866b86f8c58c5.tar.gz
Merge pull request #162 from rhenium/ky/ssl-write-multi
buffering: let #write accept multiple arguments
Diffstat (limited to 'lib')
-rw-r--r--lib/openssl/buffering.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/openssl/buffering.rb b/lib/openssl/buffering.rb
index 8b5dd9da..935f61f0 100644
--- a/lib/openssl/buffering.rb
+++ b/lib/openssl/buffering.rb
@@ -339,9 +339,11 @@ module OpenSSL::Buffering
# Writes _s_ to the stream. If the argument is not a String it will be
# converted using +.to_s+ method. Returns the number of bytes written.
- def write(s)
- do_write(s)
- s.bytesize
+ def write(*s)
+ s.inject(0) do |written, str|
+ do_write(str)
+ written + str.bytesize
+ end
end
##