mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-05 17:33:49 +00:00
Prevent full datachannel buffer on file end
This commit is contained in:
@@ -1564,7 +1564,7 @@ class FileChunker {
|
||||
}
|
||||
|
||||
_readChunk() {
|
||||
if (this._currentlySending) return;
|
||||
if (this._currentlySending || this._isFileEnd()) return;
|
||||
|
||||
this._currentlySending = true;
|
||||
const chunk = this._file.slice(this._bytesSent, this._bytesSent + this._chunkSize);
|
||||
@@ -1606,6 +1606,8 @@ class FileChunkerRTC extends FileChunker {
|
||||
}
|
||||
|
||||
_onChunkRead(chunk) {
|
||||
if (!chunk.byteLength) return;
|
||||
|
||||
this._currentlySending = false;
|
||||
|
||||
this._onChunk(chunk);
|
||||
|
||||
Reference in New Issue
Block a user