1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

webrick/server.rb: stop immediately

* lib/webrick/server.rb (WEBrick::GenericServer#start): flush
  shutdown pipe.
* lib/webrick/server.rb (WEBrick::GenericServer#stop): request the
  server to stop immediately by sending data via shutdown pipe.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51231 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-07-14 02:20:16 +00:00
parent f162f2073b
commit 77cde58d39
3 changed files with 34 additions and 11 deletions

View file

@ -137,8 +137,12 @@ class TestWEBrickServer < Test::Unit::TestCase
flunk "unexpected log: #{msg.inspect}"
end
end
client_thread = nil
wakeup = -> {client_thread.wakeup}
warn_flunk = WEBrick::Log.new(log, WEBrick::BasicLog::WARN)
server = WEBrick::HTTPServer.new(
:StartCallback => wakeup,
:StopCallback => wakeup,
:BindAddress => '0.0.0.0',
:Port => 0,
:Logger => warn_flunk)