@hyperswarm/secret-stream
Advanced tools
Comparing version 5.1.5 to 5.1.6
@@ -346,2 +346,7 @@ const { Pull, Push, HEADERBYTES, KEYBYTES, ABYTES } = require('sodium-secretstream') | ||
_predestroy () { | ||
if (this.rawStream) { | ||
const error = this._readableState.error || this._writableState.error | ||
this.rawStream.destroy(error) | ||
} | ||
if (this._startDone !== null) { | ||
@@ -356,3 +361,2 @@ const done = this._startDone | ||
this._handshakeDone = null | ||
if (this.rawStream) this.rawStream.destroy() | ||
done(new Error('Stream destroyed')) | ||
@@ -364,3 +368,2 @@ } | ||
this._drainDone = null | ||
if (this.rawStream) this.rawStream.destroy() | ||
done(new Error('Stream destroyed')) | ||
@@ -409,4 +412,2 @@ } | ||
this._resolveOpened(false) | ||
const error = this._readableState.error || this._writableState.error | ||
if (this.rawStream) this.rawStream.destroy(error) | ||
cb(null) | ||
@@ -413,0 +414,0 @@ } |
{ | ||
"name": "@hyperswarm/secret-stream", | ||
"version": "5.1.5", | ||
"version": "5.1.6", | ||
"description": "Secret stream backed by Noise and libsodium's secretstream", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
28805