1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-24 12:13:16 +00:00

1. Added writeCalledByEnd

2. Updated http-digest.request, to use pass-thru end(buffer)
This commit is contained in:
Bryan Roe
2021-07-19 19:07:03 -07:00
parent c7a4356dac
commit aec6f65906
3 changed files with 30 additions and 4 deletions

View File

@@ -159,7 +159,18 @@ function http_digest_instance(options)
this._buffered = Buffer.concat([this._buffered, chunk], this._buffered.length + chunk.length);
}
if (this._request) { this._request.write(chunk); }
if (this._request)
{
console.log('Write Called By End: ' + this.writeCalledByEnd());
if (this.writeCalledByEnd())
{
this._request.end(chunk);
}
else
{
this._request.write(chunk);
}
}
if (flush != null) { flush(); }
return (true);
},
@@ -167,7 +178,7 @@ function http_digest_instance(options)
{
if (this._ended) { throw ('Stream already ended'); }
this._ended = true;
if (this._request) { this._request.end(); }
if (this._request && !this.writeCalledByEnd()) { this._request.end(); }
if (flush != null) { flush(); }
}
});