diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-28 13:27:35 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-03-28 13:27:35 +0000 |
commit | c1718e988e24de48bf8ebe8d2421b4531dbe7b58 (patch) | |
tree | fdf8cbac970dc08dd22fa5740cb39c06867b59f3 /lib/webrick/httpresponse.rb | |
parent | b78fa27ae0b717c5569878c106a67d5047e5fb88 (diff) | |
download | ruby-c1718e988e24de48bf8ebe8d2421b4531dbe7b58.tar.gz |
get rid of test error/failure on Windows introduced at r62955
* lib/webrick/httpresponse.rb (send_body_io): use seek if NotImplementedError
is raised in IO.copy_stream with offset.
* lib/webrick/httpservlet/filehandler.rb (multipart_body): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/httpresponse.rb')
-rw-r--r-- | lib/webrick/httpresponse.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/webrick/httpresponse.rb b/lib/webrick/httpresponse.rb index 820579237f..6d77692140 100644 --- a/lib/webrick/httpresponse.rb +++ b/lib/webrick/httpresponse.rb @@ -433,7 +433,12 @@ module WEBrick size = @header['content-length'] size = size.to_i if size end - @sent_size = IO.copy_stream(@body, socket, size, offset) + begin + @sent_size = IO.copy_stream(@body, socket, size, offset) + rescue NotImplementedError + @body.seek(offset, IO::SEEK_SET) + @sent_size = IO.copy_stream(@body, socket, size) + end end ensure @body.close |