diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-19 08:39:22 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-09-19 08:39:22 +0000 |
commit | b40a9475db568d05bf33ab168ed804e3e2091293 (patch) | |
tree | 8d367e04ca2e7d4b7f6f2b448c222d6960ecc2a5 /lib/webrick | |
parent | eccbd8c0ef262b133a9c706c335244072d863bdb (diff) |
webrick: handle EAGAIN/EWOULDBLOCK on proxy connections
* lib/webrick/httpproxy.rb (do_CONNECT): high-level IO methods
[ruby-core:82861] [Bug #12130]
Patch by: Keisuke NISHI
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick')
-rw-r--r-- | lib/webrick/httpproxy.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/webrick/httpproxy.rb b/lib/webrick/httpproxy.rb index 083720f298..be5531fec0 100644 --- a/lib/webrick/httpproxy.rb +++ b/lib/webrick/httpproxy.rb @@ -193,13 +193,13 @@ module WEBrick begin while fds = IO::select([ua, os]) if fds[0].member?(ua) - buf = ua.sysread(1024); + buf = ua.readpartial(1024); @logger.debug("CONNECT: #{buf.bytesize} byte from User-Agent") - os.syswrite(buf) + os.write(buf) elsif fds[0].member?(os) - buf = os.sysread(1024); + buf = os.readpartial(1024); @logger.debug("CONNECT: #{buf.bytesize} byte from #{host}:#{port}") - ua.syswrite(buf) + ua.write(buf) end end rescue |