Comparing version 4.1.3-beta to 4.1.3-beta2
@@ -9,3 +9,3 @@ 'use strict'; | ||
var bodymaker = function (options = {}) { | ||
if (!(this instanceof bodymaker)) return new bodymaker(options); | ||
@@ -159,3 +159,5 @@ | ||
let fd = -1; | ||
//let fd = -1; | ||
let fh = null; | ||
let fret; | ||
@@ -165,4 +167,9 @@ for(let f in bodyfi) { | ||
try { | ||
fd = await fsp.open(f); | ||
await new Promise((rv, rj) => { | ||
fh = await fsp.open(f); | ||
fret = await fh.read(bodyData, seek, bodyfi[f].length, 0) | ||
seek += fret.bytesRead; | ||
/* await new Promise((rv, rj) => { | ||
fs.read(fd, bodyData, seek, bodyfi[f].length, 0, (err, bytesRead, buffer) => { | ||
@@ -176,9 +183,10 @@ if (err) { | ||
}); | ||
}); | ||
}); */ | ||
} catch (err) { | ||
throw err; | ||
} finally { | ||
if (fd > 0) { | ||
fh && fh.close && fh.close(); | ||
/* if (fd > 0) { | ||
fs.close(fd, err => {}); | ||
} | ||
} */ | ||
} | ||
@@ -185,0 +193,0 @@ } |
{ | ||
"name": "gohttp", | ||
"version": "4.1.3-beta", | ||
"version": "4.1.3-beta2", | ||
"description": "http & https client for HTTP/1.1 and HTTP/2", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
97431
1741