diff --git a/client.js b/client.js index 8db3488..73303d6 100644 --- a/client.js +++ b/client.js @@ -18,8 +18,8 @@ module.exports = function (opts) { db.emit('flush') } - function connect (opts) { - return down.createRpcStream(opts, null) + function connect (opts, proxy) { + return down.createRpcStream(opts, proxy) } function isFlushed () { diff --git a/leveldown.js b/leveldown.js index e65ce71..9ef053e 100644 --- a/leveldown.js +++ b/leveldown.js @@ -229,7 +229,9 @@ Multilevel.prototype._close = function (cb) { this._clearRequests(true) if (this._streaming) { - this._streaming.once('close', cb) + // _streaming: could be a socket and emit 'close' with a + // hadError argument. + this._streaming.once('close', () => cb()) this._streaming.destroy() } else { process.nextTick(cb)