From 95fe8f6c660a1c3bf91b5ab78f95ef0c35d8990c Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 13 Mar 2025 18:55:17 +0800 Subject: perf(session): use pointer for SRecvData --- src/session.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/session.hpp') diff --git a/src/session.hpp b/src/session.hpp index 4f5adb2..65aa7a0 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -13,16 +13,15 @@ class CSession { ~CSession(); struct SRecvData { - char data[1024] = {0}; - ssize_t dataSize = sizeof(data); - bool good = true; + std::string data; + bool good = true; }; std::string getName(); - void setSelf(std::pair> *self); + void setSelf(std::pair> *self); - SRecvData read(); - SRecvData read(const std::string &msg); + std::unique_ptr read(); + std::unique_ptr read(const std::string &msg); bool write(const std::string &msg); template bool write(std::format_string fmt, Args &&...args); -- cgit v1.2.3