X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/3cc6c36fcf3f0c6449debeb56e53c2ede03efc26..1487578f4887f49661320e24e311074a9af36f80:/projects/sgauthstress/proto.h diff --git a/projects/sgauthstress/proto.h b/projects/sgauthstress/proto.h index a63a4f90..746622b7 100644 --- a/projects/sgauthstress/proto.h +++ b/projects/sgauthstress/proto.h @@ -1,11 +1,15 @@ #ifndef __PROTO_H__ #define __PROTO_H__ +#ifndef LINUX +#include +#endif #include #include #include #include +#include #include #include @@ -43,13 +47,14 @@ class PROTO { struct sockaddr_in serverAddr; int timeout; - std::vector > users; + std::list > users; std::vector pollFds; bool running; bool stopped; pthread_t tid; + pthread_mutex_t mutex; std::string errorStr; @@ -58,9 +63,10 @@ class PROTO { static void * Runner(void * data); void Run(); + void CheckTimeouts(); 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);