mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Fix arguments to on_close
This commit is contained in:
parent
74497eabd5
commit
a928aa3d3f
2 changed files with 3 additions and 5 deletions
|
@ -129,7 +129,7 @@ module ActionCable
|
|||
# ignore
|
||||
end
|
||||
|
||||
def on_close # :nodoc:
|
||||
def on_close(reason, code) # :nodoc:
|
||||
send_async :handle_close
|
||||
end
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ module ActionCable
|
|||
@url = ClientSocket.determine_url(@env)
|
||||
|
||||
@driver = @driver_started = nil
|
||||
@close_params = ['', 1006]
|
||||
|
||||
@ready_state = CONNECTING
|
||||
|
||||
|
@ -142,10 +143,7 @@ module ActionCable
|
|||
return if @ready_state == CLOSED
|
||||
@ready_state = CLOSED
|
||||
|
||||
reason = @close_params ? @close_params[0] : ''
|
||||
code = @close_params ? @close_params[1] : 1006
|
||||
|
||||
@event_target.on_close(code, reason)
|
||||
@event_target.on_close(*@close_params)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue