mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/webrick/server.rb (WEBrick::GenericServer#accept_client):
sockets should be non-blocking mode. [ruby-dev:26405] * lib/webrick/utils.rb (WEBrick::Utils.set_non_blocking): new method. * lib/webrick/httprequest.rb (WEBrick::HTTPRequest#read_chunked): should call sock.read repeatedly until the preferred size data is obtained. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f07aefe54f
commit
c7070bdc48
4 changed files with 26 additions and 1 deletions
|
@ -18,6 +18,14 @@ end
|
|||
|
||||
module WEBrick
|
||||
module Utils
|
||||
def set_non_blocking(io)
|
||||
flag = File::NONBLOCK
|
||||
if defined?(Fcntl::F_GETFL)
|
||||
flag |= io.fcntl(Fcntl::F_GETFL)
|
||||
end
|
||||
io.fcntl(Fcntl::F_SETFL, flag)
|
||||
end
|
||||
module_function :set_non_blocking
|
||||
|
||||
def set_close_on_exec(io)
|
||||
if defined?(Fcntl::FD_CLOEXEC)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue