summaryrefslogtreecommitdiff
path: root/lib
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
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')
-rw-r--r--lib/webrick/server.rb9
-rw-r--r--lib/webrick/ssl.rb1
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/webrick/server.rb b/lib/webrick/server.rb
index c779d37354..4aafd1e7fe 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|
diff --git a/lib/webrick/ssl.rb b/lib/webrick/ssl.rb
index 5e296dbae2..19c1e104da 100644
--- a/lib/webrick/ssl.rb
+++ b/lib/webrick/ssl.rb
@@ -162,6 +162,7 @@ module WEBrick
}
end
@listeners += listeners
+ setup_shutdown_pipe
end
##