Commit c28af5c6 authored by James Lopez's avatar James Lopez

trying new workaround for shutdown_pipe issue

parent 0c25846d
......@@ -25,9 +25,21 @@ class HTTPUNIXServer < WEBrick::HTTPServer
@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)
setup_shutdown_pipe
super.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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment