- 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)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9826 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
ultramage 2007-02-08 16:36:48 +00:00
parent 34d8dc0ad3
commit 1aa9c5ceca
5 changed files with 9 additions and 8 deletions

View File

@ -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

View File

@ -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
}
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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;