mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/xmlrpc/server.rb (XMLRPC::Server#server): Improve signal handling so
pressing control-c in the controlling terminal or sending SIGTERM stops the XML-RPC server. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d5bd9d1593
commit
d92b461dd9
2 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
Wed Dec 2 01:00:07 2007 James Edward Gray II <jeg2@ruby-lang.org>
|
||||
|
||||
* lib/xmlrpc/server.rb (XMLRPC::Server#server): Improve signal handling so
|
||||
pressing control-c in the controlling terminal or sending SIGTERM stops
|
||||
the XML-RPC server.
|
||||
|
||||
Sat Dec 1 23:04:42 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* encoding.c: rename primary_encoding -> default_external (encoding).
|
||||
|
|
|
@ -639,11 +639,11 @@ class Server < WEBrickServlet
|
|||
|
||||
def serve
|
||||
if RUBY_PLATFORM =~ /mingw|mswin32/
|
||||
signal = 1
|
||||
signals = [1]
|
||||
else
|
||||
signal = "HUP"
|
||||
signals = %w[INT TERM HUP]
|
||||
end
|
||||
trap(signal) { @server.shutdown }
|
||||
signals.each { |signal| trap(signal) { @server.shutdown } }
|
||||
|
||||
@server.start
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue