- Fix bug when receiving file: passing a to-be-cleared buffer by referrence
This commit is contained in:
Linloir 2022-10-19 11:22:20 +08:00
parent 4504c196f6
commit 68f8d51d3b
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366

View File

@ -1,7 +1,7 @@
/*
* @Author : Linloir
* @Date : 2022-10-08 15:10:04
* @LastEditTime : 2022-10-19 00:54:03
* @LastEditTime : 2022-10-19 10:41:12
* @Description :
*/
@ -184,7 +184,7 @@ class TCPController {
else {
//Part of payload
//Transmit all to stream
_payloadPullStreamController.add(buffer);
_payloadPullStreamController.add([...buffer]);
//Reduce payload bytes left
payloadLength -= buffer.length;
//Clear buffer