summaryrefslogtreecommitdiff
path: root/lib/webrick/server.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-10 11:05:00 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-11-10 11:05:00 +0000
commit33bb38a644c62edadec677465b2b08eea4756593 (patch)
tree874f34213585bda9bedebebb79f8eb01d2a3ad3c /lib/webrick/server.rb
parentfd9f6bde957ce681fed49182be02124ecc89b362 (diff)
* lib/webrick/server.rb: Setup shutdown pipe in listen method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/webrick/server.rb')
-rw-r--r--lib/webrick/server.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index c779d37..4aafd1e 100644
--- a/lib/webrick/server.rb
+++ b/lib/webrick/server.rb
@@ -115,7 +115,6 @@ module WEBrick
if @config[:Port] == 0
@config[:Port] = @listeners[0].addr[1]
end
- @shutdown_pipe = IO.pipe
end
end
@@ -132,6 +131,7 @@ module WEBrick
def listen(address, port)
@listeners += Utils::create_listeners(address, port, @logger)
+ setup_shutdown_pipe
end
##
@@ -321,6 +321,13 @@ module WEBrick
end
end
+ def setup_shutdown_pipe
+ if !@shutdown_pipe
+ @shutdown_pipe = IO.pipe
+ end
+ @shutdown_pipe
+ end
+
def cleanup_shutdown_pipe(shutdown_pipe)
@shutdown_pipe = nil
shutdown_pipe.each {|io|