diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-19 15:44:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-19 15:44:41 +0300 |
commit | 94d65b487d458341e3626bcfa41fa09c1c240d89 (patch) | |
tree | debf415d1ee3314a6a746fc4fe8f296f4f8f5472 /src/net/tmwa/network.cpp | |
parent | 1768a3c449f0bb9ac1533781f5134eebe0f9c458 (diff) | |
download | plus-94d65b487d458341e3626bcfa41fa09c1c240d89.tar.gz plus-94d65b487d458341e3626bcfa41fa09c1c240d89.tar.bz2 plus-94d65b487d458341e3626bcfa41fa09c1c240d89.tar.xz plus-94d65b487d458341e3626bcfa41fa09c1c240d89.zip |
Flush send buffer if it too big.
Diffstat (limited to 'src/net/tmwa/network.cpp')
-rw-r--r-- | src/net/tmwa/network.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index 32b1174c1..4f2f85a51 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -503,4 +503,15 @@ uint16_t Network::readWord(int pos) #endif } +void Network::fixSendBuffer() +{ + if (mOutSize > BUFFER_LIMIT) + { + if (mState != CONNECTED) + mOutSize = 0; + else + flush(); + } +} + } // namespace TmwAthena |