mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-23 00:06:18 -04:00
Prevent full datachannel buffer on file end
This commit is contained in:
parent
91fc2b7bf5
commit
cfe5b4afda
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue