From: Maxim Mamontov <faust@gts.dp.ua>
Date: Wed, 11 May 2011 11:13:57 +0000 (+0300)
Subject: Users container changed from vector to list
X-Git-Tag: 2.407-p1~8
X-Git-Url: https://git.stg.codes/stg.git/commitdiff_plain/9abe42ea3c72567b721e860eab1e5ae77662bb56?ds=inline

Users container changed from vector to list
---

diff --git a/projects/sgauthstress/proto.h b/projects/sgauthstress/proto.h
index a63a4f90..ed17f876 100644
--- a/projects/sgauthstress/proto.h
+++ b/projects/sgauthstress/proto.h
@@ -6,6 +6,7 @@
 #include <poll.h>
 
 #include <string>
+#include <list>
 #include <vector>
 #include <map>
 
@@ -43,13 +44,14 @@ class PROTO {
         struct sockaddr_in serverAddr;
         int timeout;
 
-        std::vector<std::pair<uint32_t, USER> > users;
+        std::list<std::pair<uint32_t, USER> > users;
         std::vector<struct pollfd> pollFds;
 
         bool running;
         bool stopped;
 
         pthread_t tid;
+        pthread_mutex_t mutex;
 
         std::string errorStr;
 
@@ -60,7 +62,7 @@ class PROTO {
         void Run();
         bool RecvPacket();
         bool SendPacket(const void * buffer, size_t length, USER * user);
-        bool HandlePacket(const char * buffer, USER * user);
+        bool HandlePacket(const char * buffer, size_t length, USER * user);
 
         bool CONN_SYN_ACK_Proc(const void * buffer, USER * user);
         bool ALIVE_SYN_Proc(const void * buffer, USER * user);