summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog-Trunk.txt4
-rw-r--r--src/common/core.c2
-rw-r--r--src/common/socket.c5
-rw-r--r--src/common/socket.h4
-rw-r--r--src/ladmin/ladmin.c2
5 files changed, 9 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index ebc0b103c..1f6d4288b 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,10 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2007/02/08
+ * Fixed the new socket code, which was triggering the inactivity timeout
+ on the servers' listening sockets
+ * Fixed the TURBO code not working since r4468 (parse func never called)
2007/02/07
* More aggressive cleaning up of the socket code [ultramage]
- removed unused session_data2 entry in sd
diff --git a/src/common/core.c b/src/common/core.c
index f0ab846d1..94d7272ad 100644
--- a/src/common/core.c
+++ b/src/common/core.c
@@ -264,9 +264,7 @@ int main (int argc, char **argv)
while (runflag) {
next = do_timer(gettick_nocache());
do_sendrecv(next);
- #ifndef TURBO
do_parsepacket();
- #endif
}
}
diff --git a/src/common/socket.c b/src/common/socket.c
index 2a6011a22..43422da85 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -133,7 +133,7 @@ void set_nonblocking(int fd, int yes)
{
// TCP_NODELAY BOOL Disables the Nagle algorithm for send coalescing.
if(mode_neg)
- setsockopt(fd, IPPROTO_TCP, TCP_NODELAY,(char *)&yes, sizeof yes);
+ setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (char *)&yes, sizeof yes);
// FIONBIO Use with a nonzero argp parameter to enable the nonblocking mode of socket s.
// The argp parameter is zero if nonblocking is to be disabled.
@@ -291,6 +291,7 @@ int connect_client(int listen_fd)
create_session(fd, recv_to_fifo, send_from_fifo, default_func_parse);
session[fd]->client_addr = client_address;
+ session[fd]->rdata_tick = last_tick;
return fd;
}
@@ -380,6 +381,7 @@ int make_connection(long ip, int port)
FD_SET(fd,&readfds);
create_session(fd, recv_to_fifo, send_from_fifo, default_func_parse);
+ session[fd]->rdata_tick = last_tick;
return fd;
}
@@ -394,7 +396,6 @@ int create_session(int fd, RecvFunc func_recv, SendFunc func_send, ParseFunc fun
session[fd]->func_recv = func_recv;
session[fd]->func_send = func_send;
session[fd]->func_parse = func_parse;
- session[fd]->rdata_tick = last_tick;
return 0;
}
diff --git a/src/common/socket.h b/src/common/socket.h
index dc156318c..1c4a1bd8c 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -81,8 +81,8 @@ struct socket_data {
size_t max_rdata, max_wdata;
size_t rdata_size, wdata_size;
size_t rdata_pos;
- time_t rdata_tick;
- struct sockaddr_in client_addr;
+ time_t rdata_tick; // time of last receive (for detecting timeouts)
+ struct sockaddr_in client_addr; // remote client address (zero for s2s connections)
void* session_data;
RecvFunc func_recv;
SendFunc func_send;
diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c
index 29f2ce404..343967d46 100644
--- a/src/ladmin/ladmin.c
+++ b/src/ladmin/ladmin.c
@@ -4427,9 +4427,7 @@ int do_init(int argc, char **argv)
while (runflag) {
next = do_timer(gettick_nocache());
do_sendrecv(next);
-#ifndef TURBO
do_parsepacket();
-#endif
}
return 0;