[Pkg-javascript-commits] [sockjs-client] 48/350: Add missing onerror listener for WebSockets

tonnerre at ancient-solutions.com tonnerre at ancient-solutions.com
Fri Aug 5 01:03:40 UTC 2016


This is an automated email from the git hooks/post-receive script.

tonnerre-guest pushed a commit to branch upstream
in repository sockjs-client.

commit b8b0e5fe4d925b4009fbe4e669067e0a29823d41
Author: Luigi Pinca <luigipinca at gmail.com>
Date:   Sat May 24 11:48:57 2014 +0200

    Add missing onerror listener for WebSockets
---
 lib/trans-websocket.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/trans-websocket.js b/lib/trans-websocket.js
index 7f6362a..b967f22 100644
--- a/lib/trans-websocket.js
+++ b/lib/trans-websocket.js
@@ -29,7 +29,7 @@ var WebSocketTransport = SockJS.websocket = function(ri, trans_url) {
     // https://github.com/sockjs/sockjs-client/issues/28
     // https://bugzilla.mozilla.org/show_bug.cgi?id=696085
     that.unload_ref = utils.unload_add(function(){that.ws.close()});
-    that.ws.onclose = function() {
+    that.ws.onclose = that.ws.onerror = function() {
         that.ri._didMessage(utils.closeFrame(1006, "WebSocket connection broken"));
     };
 };
@@ -42,7 +42,7 @@ WebSocketTransport.prototype.doCleanup = function() {
     var that = this;
     var ws = that.ws;
     if (ws) {
-        ws.onmessage = ws.onclose = null;
+        ws.onmessage = ws.onclose = ws.onerror = null;
         ws.close();
         utils.unload_del(that.unload_ref);
         that.unload_ref = that.ri = that.ws = null;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/sockjs-client.git



More information about the Pkg-javascript-commits mailing list