diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-03-20 21:23:55 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-03-21 11:18:14 +0800 |
| commit | 07b4028a75a6ad79258ee82c56c7e20496c72244 (patch) | |
| tree | f998adcd2307d860e34db42422f3a29e0ddae676 /src | |
| parent | bc23856add348060b600fd0f9cbccfd79b744af5 (diff) | |
session(SRecvData): use false as default
so if something was wrong(the function directly returned or smth,
it'd be good = false)
Diffstat (limited to 'src')
| -rw-r--r-- | src/session.cpp | 4 | ||||
| -rw-r--r-- | src/session.hpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/session.cpp b/src/session.cpp index 10c549b..ee4c098 100644 --- a/src/session.cpp +++ b/src/session.cpp @@ -100,8 +100,10 @@ std::unique_ptr<CSession::SRecvData> CSession::read() { onErrno(READ); } else if (size == 0) recvData->good = false; - else + else { recvData->data.resize(size); + recvData->good = true; + } #ifdef DEBUG onRecv(*recvData); diff --git a/src/session.hpp b/src/session.hpp index b9c1cc1..c4525bd 100644 --- a/src/session.hpp +++ b/src/session.hpp @@ -15,7 +15,7 @@ class CSession { struct SRecvData { std::string data; const size_t size = 1024; - bool good = true; + bool good = false; bool isEmpty() const; void sanitize(); |
