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/httpservlet | |
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/httpservlet')
-rw-r--r-- | lib/webrick/httpservlet/filehandler.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/webrick/httpservlet/filehandler.rb b/lib/webrick/httpservlet/filehandler.rb index e4d892ee66..0072e81ac6 100644 --- a/lib/webrick/httpservlet/filehandler.rb +++ b/lib/webrick/httpservlet/filehandler.rb @@ -100,7 +100,12 @@ module WEBrick "#{CRLF}" ) - IO.copy_stream(body, socket, last - first + 1, first) + begin + IO.copy_stream(body, socket, last - first + 1, first) + rescue NotImplementedError + body.seek(first, IO::SEEK_SET) + IO.copy_stream(body, socket, last - first + 1) + end socket.write(CRLF) end while parts[0] socket.write("--#{boundary}--#{CRLF}") |