destroy input stream on error

This commit is contained in:
Girish Ramakrishnan
2020-05-15 15:21:24 -07:00
parent 235047ad0b
commit 32f232d3c0
+4 -1
View File
@@ -632,7 +632,10 @@ function tarExtract(inStream, dataLayout, encryption, callback) {
}
});
const emitError = once((error) => ps.emit('error', error));
const emitError = once((error) => {
inStream.destroy();
ps.emit('error', error);
});
inStream.on('error', function (error) {
debug('tarExtract: input stream error.', error);