Feature #6236 » webrick.signal_exception.patch
lib/webrick/server.rb (working copy) | ||
---|---|---|
rescue Errno::EBADF, IOError => ex
|
||
# if the listening socket was closed in GenericServer#shutdown,
|
||
# IO::select raise it.
|
||
rescue Interrupt => ex # ^C
|
||
rescue SignalException => ex
|
||
@logger.fatal ex
|
||
raise
|
||
rescue Exception => ex
|
test/webrick/test_server.rb (working copy) | ||
---|---|---|
:StopCallback => Proc.new{ stopped += 1 },
|
||
}
|
||
e = assert_raises(Interrupt) do
|
||
e = assert_raises(SignalException) do
|
||
TestWEBrick.start_server(Echo, config) { |server, addr, port, log|
|
||
listener = server.listeners.first
|
||
def listener.accept
|
||
Process.kill(:INT, $$) # simulate ^C
|
||
raise SignalException, 'SIGTERM' # simulate signal in main thread
|
||
end
|
||
Thread.pass while server.status != :Running
|
- « Previous
- 1
- 2
- Next »