diff options
author | Matthew Draper <matthew@trebex.net> | 2016-01-25 03:55:05 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-01-30 03:46:37 +1030 |
commit | a928aa3d3f1e6f8780acc22d69f4d5d1f5917926 (patch) | |
tree | b8c6583fb674857fb5d0c60b7aa6c914cb5adeca /actioncable/lib | |
parent | 74497eabd52f2f9f8c383808b11286283046c2b2 (diff) | |
download | rails-a928aa3d3f1e6f8780acc22d69f4d5d1f5917926.tar.gz rails-a928aa3d3f1e6f8780acc22d69f4d5d1f5917926.tar.bz2 rails-a928aa3d3f1e6f8780acc22d69f4d5d1f5917926.zip |
Fix arguments to on_close
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/connection/base.rb | 2 | ||||
-rw-r--r-- | actioncable/lib/action_cable/connection/client_socket.rb | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/actioncable/lib/action_cable/connection/base.rb b/actioncable/lib/action_cable/connection/base.rb index 0016d1a1a4..b5f898436a 100644 --- a/actioncable/lib/action_cable/connection/base.rb +++ b/actioncable/lib/action_cable/connection/base.rb @@ -129,7 +129,7 @@ module ActionCable # ignore end - def on_close # :nodoc: + def on_close(reason, code) # :nodoc: send_async :handle_close end diff --git a/actioncable/lib/action_cable/connection/client_socket.rb b/actioncable/lib/action_cable/connection/client_socket.rb index 62dd753646..ef937d7c16 100644 --- a/actioncable/lib/action_cable/connection/client_socket.rb +++ b/actioncable/lib/action_cable/connection/client_socket.rb @@ -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 |