summaryrefslogtreecommitdiff
path: root/src/common/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/socket.h')
-rw-r--r--src/common/socket.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/common/socket.h b/src/common/socket.h
index cdbac8f00..73322a206 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -35,7 +35,7 @@
#define RFIFOSPACE(fd) (session[fd]->max_rdata - session[fd]->rdata_size)
#define WFIFOSPACE(fd) (session[fd]->max_wdata - session[fd]->wdata_size)
-#define RFIFOREST(fd) (session[fd]->eof ? 0 : session[fd]->rdata_size - session[fd]->rdata_pos)
+#define RFIFOREST(fd) (session[fd]->flag.eof ? 0 : session[fd]->rdata_size - session[fd]->rdata_pos)
#define RFIFOFLUSH(fd) \
do { \
if(session[fd]->rdata_size == session[fd]->rdata_pos){ \
@@ -70,16 +70,19 @@ typedef int (*ParseFunc)(int fd);
struct socket_data
{
- unsigned char eof;
+ struct {
+ unsigned char eof : 1;
+ unsigned char server : 1;
+ } flag;
- unsigned char *rdata, *wdata;
+ uint32 client_addr; // remote client address
+
+ uint8 *rdata, *wdata;
size_t max_rdata, max_wdata;
size_t rdata_size, wdata_size;
size_t rdata_pos;
time_t rdata_tick; // time of last recv (for detecting timeouts); zero when timeout is disabled
- uint32 client_addr; // remote client address (0 for server connections)
-
RecvFunc func_recv;
SendFunc func_send;
ParseFunc func_parse;