[前][次][番号順一覧][スレッド一覧]

ruby-changes:47845

From: normal <ko1@a...>
Date: Tue, 19 Sep 2017 17:39:27 +0900 (JST)
Subject: [ruby-changes:47845] normal:r59965 (trunk): webrick: handle EAGAIN/EWOULDBLOCK on proxy connections

normal	2017-09-19 17:39:22 +0900 (Tue, 19 Sep 2017)

  New Revision: 59965

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59965

  Log:
    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

  Modified files:
    trunk/lib/webrick/httpproxy.rb
Index: lib/webrick/httpproxy.rb
===================================================================
--- lib/webrick/httpproxy.rb	(revision 59964)
+++ lib/webrick/httpproxy.rb	(revision 59965)
@@ -193,13 +193,13 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpproxy.rb#L193
       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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]