mirror of
https://github.com/Linloir/Simple-TCP-Server.git
synced 2025-12-16 23:48:11 +08:00
Fix Bugs
- Fix bug when receiving file: passing a to-be-cleared buffer by referrence
This commit is contained in:
parent
4504c196f6
commit
68f8d51d3b
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user