aboutsummaryrefslogtreecommitdiffstats
path: root/lib/webrick
diff options
context:
space:
mode:
Diffstat (limited to 'lib/webrick')
-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
##