summaryrefslogtreecommitdiff
path: root/spec/httpunix_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/httpunix_spec.rb')
-rw-r--r--spec/httpunix_spec.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/httpunix_spec.rb b/spec/httpunix_spec.rb
index cd2ede9..0fcff4a 100644
--- a/spec/httpunix_spec.rb
+++ b/spec/httpunix_spec.rb
@@ -24,6 +24,23 @@ class HTTPUNIXServer < WEBrick::HTTPServer
socket.close
@listeners << server
end
+
+ # Workaround:
+ # https://bugs.ruby-lang.org/issues/10956
+ # Affecting Ruby 2.2
+ # Fix for 2.2 is at https://github.com/ruby/ruby/commit/ab0a64e1
+ # However, this doesn't work with 2.1. The following should work for both:
+ def start(&block)
+ @shutdown_pipe = IO.pipe
+ shutdown_pipe = @shutdown_pipe
+ super(&block)
+ end
+
+ def cleanup_shutdown_pipe(shutdown_pipe)
+ @shutdown_pipe = nil
+ return if !shutdown_pipe
+ super(shutdown_pipe)
+ end
end
def tmp_socket_path