Skip to content

Commit a32f156

Browse files
authoredMay 10, 2023
Merge pull request #274 from Durisvk/master
End stream before closing & Prefer req.destroy() before req.abort() if available
2 parents 341f258 + e3d7c7c commit a32f156

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed
 

‎.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
language: node_js
22
node_js:
3+
- "lts/*"
4+
- "17"
5+
- "16"
6+
- "15"
7+
- "14"
38
- "13"
49
- "12"
510
- "10"

‎lib/Open/unzip.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ module.exports = function unzip(source,offset,_password, directoryVars) {
106106
.on('error',function(err) { entry.emit('error',err);})
107107
.pipe(entry)
108108
.on('finish', function() {
109-
if (req.abort)
109+
if(req.destroy)
110+
req.destroy()
111+
else if (req.abort)
110112
req.abort();
111113
else if (req.close)
112114
req.close();

‎lib/parse.js

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function Parse(opts) {
2626

2727
PullStream.call(self, self._opts);
2828
self.on('finish',function() {
29+
self.emit('end');
2930
self.emit('close');
3031
});
3132
self._readRecord().catch(function(e) {

0 commit comments

Comments
 (0)
Please sign in to comment.