Skip to content

Commit 6196f8c

Browse files
committed
Merge pull request #414 from uProxy/trevj-ssh-crashes
trap errors coming from nodejs tcp socket read handlers
2 parents bb03368 + 660e067 commit 6196f8c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/cloud/social/shim/tcp.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ FreedomTCP.prototype._onRead = function(readInfo) {
2525
//console.warn('read ' + len +': ' + str);
2626

2727
if (this.reading) {
28-
this.onread(len, buf);
28+
try {
29+
this.onread(len, buf);
30+
} catch (e) {
31+
console.error('nodejs socket read handler raised en error', e);
32+
}
2933
} else {
3034
this.bufferedReads.push({buf: buf, len: len});
3135
}

0 commit comments

Comments
 (0)