Fix CreateReadStream asychronicity

This commit is contained in:
Mitra Ardron 2018-09-16 20:51:28 +10:00
parent 82a696f51f
commit 13f1302bb4
3 changed files with 4 additions and 4 deletions

View File

@ -174,7 +174,7 @@ class TransportHTTP extends Transport {
if (wanturl) {
return url;
} else {
return function (opts) { return self.p_createReadStream(url, opts); };
return function (opts) { return self.createReadStream(url, opts); };
}
} catch(err) {
//Logged by Transports
@ -183,7 +183,7 @@ class TransportHTTP extends Transport {
}
}
async createReadStream(url, opts) {
createReadStream(url, opts) {
/*
The function, encapsulated and inside another function by p_f_createReadStream (see docs)
NOTE THIS DOESNT WONT WORK FOR <VIDEO> tags, but shouldnt be using it there anyway - reports stream.on an filestream.pipe aren't functions

View File

@ -188,7 +188,7 @@ class Transports {
throws: CodingError if urls empty or [undefined ... ]
*/
if (!urls.length) throw new errors.TransportError("Transports.p_rawfetch given an empty list of urls");
let resolvedurls = await this.p_resolveNames(urls); // If naming is loaded then convert to a name
let resolvedurls = await this.p_resolveNames(urls); // If naming is loaded then convert name to [urls]
if (!resolvedurls.length) throw new errors.TransportError("Transports.p_rawfetch none of the urls resolved: " + urls);
let tt = this.validFor(resolvedurls, "fetch"); //[ [Url,t],[Url,t]] throws CodingError on empty /undefined urls
if (!tt.length) {

View File

@ -51,5 +51,5 @@
"test": "cd src; node ./test.js",
"help": "echo 'test (test it)'; echo 'build (creates dweb-transports-bundle)'"
},
"version": "0.1.18"
"version": "0.1.19"
}