[Pkg-javascript-commits] [ltx] 134/469: catch more 'error' events

Jonas Smedegaard dr at jones.dk
Wed Aug 31 13:01:15 UTC 2016


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

js pushed a commit to branch master
in repository ltx.

commit 7308ded15ba60fc54ff7cf84dee2a8d9522cc58e
Author: Astro <astro at spaceboyz.net>
Date:   Thu Sep 9 21:55:03 2010 +0200

    catch more 'error' events
---
 lib/xmpp/router.js | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/xmpp/router.js b/lib/xmpp/router.js
index 6ff63dd..50b129c 100644
--- a/lib/xmpp/router.js
+++ b/lib/xmpp/router.js
@@ -194,10 +194,12 @@ DomainContext.prototype.addInStream = function(srcDomain, stream) {
     this.setupStream(srcDomain, stream);
     stream.isConnected = true;
     stream.isAuthed = true;
-    stream.addListener('close', function() {
+    var closeCb = function() {
         if (self.s2sIn[srcDomain] == stream)
             delete self.s2sIn[srcDomain];
-    });
+    };
+    stream.addListener('close', closeCb);
+    stream.addListener('error', closeCb);
     this.s2sIn[srcDomain] = stream;
 };
 
@@ -403,6 +405,7 @@ Router.prototype.acceptConnection = function(socket) {
     // Unhandled 'error' events will trigger exceptions, don't let
     // that happen:
     socket.addListener('error', function() { });
+    this.addListener('error', function() { });
 
     var inStream = new Server.IncomingServer(socket, this.credentials);
     this.setupStream(inStream);

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



More information about the Pkg-javascript-commits mailing list