diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-08-19 15:44:41 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-08-27 02:08:08 +0300 |
commit | 0983fb8a5a159951523acb4af365345feb7b5b69 (patch) | |
tree | 1ead940cf113ea937063d049bbe7658faef3ca40 /src/net/tmwa/network.cpp | |
parent | b4dcdb89cfe1b59bda35ae0cb60148dc7727fec2 (diff) | |
download | plus-0983fb8a5a159951523acb4af365345feb7b5b69.tar.gz plus-0983fb8a5a159951523acb4af365345feb7b5b69.tar.bz2 plus-0983fb8a5a159951523acb4af365345feb7b5b69.tar.xz plus-0983fb8a5a159951523acb4af365345feb7b5b69.zip |
Increase buffers size and flush send buffer if it too big.mageia2
Diffstat (limited to 'src/net/tmwa/network.cpp')
-rw-r--r-- | src/net/tmwa/network.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index 5d5a84a64..9c84b2e25 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -87,7 +87,8 @@ short packet_lengths[] = -1, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -const unsigned int BUFFER_SIZE = 655360; +const unsigned int BUFFER_SIZE = 1000000; +const unsigned int BUFFER_LIMIT = 930000; namespace TmwAthena { @@ -487,4 +488,15 @@ Uint16 Network::readWord(int pos) #endif } +void Network::fixSendBuffer() +{ + if (mOutSize > BUFFER_LIMIT) + { + if (mState != CONNECTED) + mOutSize = 0; + else + flush(); + } +} + } // namespace TmwAthena |