提交 3120b51d 编写于 作者: T Tinco Andringa

close hijacked i/o socket after use (fixes #25613)

上级 b036b7a8
......@@ -50,6 +50,7 @@ def hijack_rack_socket
def clean_rack_hijack
return unless @rack_hijack_io
@event_loop.detach(@rack_hijack_io, self)
@rack_hijack_io.close
@rack_hijack_io = nil
end
end
......
......@@ -48,6 +48,20 @@ def on_error(message)
end
end
test 'closes hijacked i/o socket at shutdown' do
skip if ENV['FAYE'].present?
run_in_eventmachine do
connection = open_connection
client = connection.websocket.send(:websocket)
client.instance_variable_get('@stream')
.instance_variable_get('@rack_hijack_io')
.expects(:close)
connection.close
end
end
private
def open_connection
env = Rack::MockRequest.env_for '/test',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册