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