File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed
lib/action_cable/connection Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ def hijack_rack_socket
50
50
def clean_rack_hijack
51
51
return unless @rack_hijack_io
52
52
@event_loop . detach ( @rack_hijack_io , self )
53
+ @rack_hijack_io . close
53
54
@rack_hijack_io = nil
54
55
end
55
56
end
Original file line number Diff line number Diff line change @@ -48,6 +48,20 @@ def on_error(message)
48
48
end
49
49
end
50
50
51
+ test 'closes hijacked i/o socket at shutdown' do
52
+ skip if ENV [ 'FAYE' ] . present?
53
+
54
+ run_in_eventmachine do
55
+ connection = open_connection
56
+
57
+ client = connection . websocket . send ( :websocket )
58
+ client . instance_variable_get ( '@stream' )
59
+ . instance_variable_get ( '@rack_hijack_io' )
60
+ . expects ( :close )
61
+ connection . close
62
+ end
63
+ end
64
+
51
65
private
52
66
def open_connection
53
67
env = Rack ::MockRequest . env_for '/test' ,
You can’t perform that action at this time.
0 commit comments