mirror of
https://github.com/Linloir/Simple-TCP-Server.git
synced 2026-02-04 13:03:34 +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
|
* @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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user