summaryrefslogtreecommitdiff
path: root/src/net/eathena/network.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-08-06 21:56:25 +0300
committerAndrei Karas <akaras@inbox.ru>2012-08-06 21:56:25 +0300
commit7c30708a194f37fd2dc748256c72d8b06badd0fc (patch)
treef8eaf4a03fdc542200299b654e1e0db7e69f3677 /src/net/eathena/network.cpp
parent3dea83eeef37e201a3a32d7824377a1a49c73964 (diff)
downloadplus-7c30708a194f37fd2dc748256c72d8b06badd0fc.tar.gz
plus-7c30708a194f37fd2dc748256c72d8b06badd0fc.tar.bz2
plus-7c30708a194f37fd2dc748256c72d8b06badd0fc.tar.xz
plus-7c30708a194f37fd2dc748256c72d8b06badd0fc.zip
Change a bit network buffers and add check.
Diffstat (limited to 'src/net/eathena/network.cpp')
-rw-r--r--src/net/eathena/network.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp
index 17514d025..e7e15d8e4 100644
--- a/src/net/eathena/network.cpp
+++ b/src/net/eathena/network.cpp
@@ -112,7 +112,8 @@ short packet_lengths[] =
0, 0, 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;
int networkThread(void *data)
{
@@ -443,6 +444,13 @@ void Network::receive()
case 1:
// Receive data from the socket
SDL_mutexP(mMutex);
+ if (mInSize > BUFFER_LIMIT)
+ {
+ SDL_mutexV(mMutex);
+ SDL_Delay(100);
+ continue;
+ }
+
ret = SDLNet_TCP_Recv(mSocket, mInBuffer + mInSize,
BUFFER_SIZE - mInSize);