summaryrefslogtreecommitdiff
path: root/lib/webrick
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-10 11:05:21 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-10 11:05:21 +0000
commitab0a64e1c87d8fd9d0a6ee8bb6bc084d0a6f482b (patch)
tree7c827ee68f0bafd6c3712d069809f438e3d979ca /lib/webrick
parentacc17bfc0f408846f07dff0c1f6f3d0f64390b81 (diff)
* lib/webrick/server.rb: Invoke setup_shutdown_pipe in start method
instead of listen method. [ruby-core:68476] [Bug #10956] Reported by Shintaro Kojima. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick')
-rw-r--r--lib/webrick/server.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index f1f0d81fdf..8b53939c52 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -131,7 +131,6 @@ module WEBrick
def listen(address, port)
@listeners += Utils::create_listeners(address, port)
- setup_shutdown_pipe
end
##
@@ -159,6 +158,8 @@ module WEBrick
raise ServerError, "already started." if @status != :Stop
server_type = @config[:ServerType] || SimpleServer
+ setup_shutdown_pipe
+
server_type.start{
@logger.info \
"#{self.class}#start: pid=#{$$} port=#{@config[:Port]}"
@@ -330,6 +331,7 @@ module WEBrick
def cleanup_shutdown_pipe(shutdown_pipe)
@shutdown_pipe = nil
+ return if !shutdown_pipe
shutdown_pipe.each {|io|
if !io.closed?
begin