git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Better names for service iterators.
[stg.git]
/
projects
/
sgauthstress
/
proto.h
diff --git
a/projects/sgauthstress/proto.h
b/projects/sgauthstress/proto.h
index a63a4f90c3e6e7bf5df600363d5509fc62b9f6e2..746622b77b40a1c9794b430f6770513a2828731b 100644
(file)
--- a/
projects/sgauthstress/proto.h
+++ b/
projects/sgauthstress/proto.h
@@
-1,11
+1,15
@@
#ifndef __PROTO_H__
#define __PROTO_H__
#ifndef __PROTO_H__
#define __PROTO_H__
+#ifndef LINUX
+#include <netinet/in_systm.h>
+#endif
#include <netinet/ip.h>
#include <pthread.h>
#include <poll.h>
#include <string>
#include <netinet/ip.h>
#include <pthread.h>
#include <poll.h>
#include <string>
+#include <list>
#include <vector>
#include <map>
#include <vector>
#include <map>
@@
-43,13
+47,14
@@
class PROTO {
struct sockaddr_in serverAddr;
int timeout;
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;
std::vector<struct pollfd> pollFds;
bool running;
bool stopped;
pthread_t tid;
+ pthread_mutex_t mutex;
std::string errorStr;
std::string errorStr;
@@
-58,9
+63,10
@@
class PROTO {
static void * Runner(void * data);
void Run();
static void * Runner(void * data);
void Run();
+ void CheckTimeouts();
bool RecvPacket();
bool SendPacket(const void * buffer, size_t length, USER * user);
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);
bool CONN_SYN_ACK_Proc(const void * buffer, USER * user);
bool ALIVE_SYN_Proc(const void * buffer, USER * user);