diff --git a/server/SynchronousSocket.cpp b/server/SynchronousSocket.cpp index a8da3f7..4b32552 100644 --- a/server/SynchronousSocket.cpp +++ b/server/SynchronousSocket.cpp @@ -95,7 +95,7 @@ string SynchronousSocket::Receive(int amount) time_t start = time(NULL); while ((int)r.length() < amount) { - char buf[1024]; + char buf[BUFFER_SIZE]; int to_recv = min((int)sizeof(buf), amount - (int)r.length()); int res = recv(socket, buf, to_recv, 0); if (res == 0) diff --git a/server/SynchronousSocket.h b/server/SynchronousSocket.h index 8fd126e..6fcaee4 100644 --- a/server/SynchronousSocket.h +++ b/server/SynchronousSocket.h @@ -9,6 +9,7 @@ class SynchronousSocket { private: const int TIMEOUT = 10; // in seconds + const int BUFFER_SIZE = 1048576; protected: // собственно сокет int socket;