aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <dan@danfinlay.com>2016-09-14 03:07:29 +0800
committerDan Finlay <dan@danfinlay.com>2016-09-14 03:07:29 +0800
commite10c651db05c4d2c69618e49db0f24280e93f5ff (patch)
tree8a754b0c8ab3d3ff8b93466a4176421534e64304
parentb13eaaa0cd201704a63e30f3601552c136c9278c (diff)
downloadtangerine-wallet-browser-e10c651db05c4d2c69618e49db0f24280e93f5ff.tar
tangerine-wallet-browser-e10c651db05c4d2c69618e49db0f24280e93f5ff.tar.gz
tangerine-wallet-browser-e10c651db05c4d2c69618e49db0f24280e93f5ff.tar.bz2
tangerine-wallet-browser-e10c651db05c4d2c69618e49db0f24280e93f5ff.tar.lz
tangerine-wallet-browser-e10c651db05c4d2c69618e49db0f24280e93f5ff.tar.xz
tangerine-wallet-browser-e10c651db05c4d2c69618e49db0f24280e93f5ff.tar.zst
tangerine-wallet-browser-e10c651db05c4d2c69618e49db0f24280e93f5ff.zip
Fix port stream end bug
Emitting `end` or `close` was not ending the stream. Pushing a null packet also closes a stream, so I did that instead. Fixes #616
-rw-r--r--app/scripts/lib/port-stream.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/scripts/lib/port-stream.js b/app/scripts/lib/port-stream.js
index 1889e3c04..6f59d4485 100644
--- a/app/scripts/lib/port-stream.js
+++ b/app/scripts/lib/port-stream.js
@@ -30,8 +30,7 @@ PortDuplexStream.prototype._onMessage = function (msg) {
PortDuplexStream.prototype._onDisconnect = function () {
try {
- // this.end()
- this.emit('close')
+ this.push(null)
} catch (err) {
this.emit('error', err)
}