diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-09 21:23:02 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-09 21:23:02 +0000 |
commit | 5b05a6ab3e2831fcf3a4fc68f746dc29edff6339 (patch) | |
tree | 7782f96b6d472bdd5c37a845760d5b3114bc30ba | |
parent | 09089f3858b348b204c8e56775b0445000305642 (diff) | |
download | hercules-5b05a6ab3e2831fcf3a4fc68f746dc29edff6339.tar.gz hercules-5b05a6ab3e2831fcf3a4fc68f746dc29edff6339.tar.bz2 hercules-5b05a6ab3e2831fcf3a4fc68f746dc29edff6339.tar.xz hercules-5b05a6ab3e2831fcf3a4fc68f746dc29edff6339.zip |
Fixed socket.c using time() incorrectly, causing stall timer desynchronization (bugreport:394)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11702 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/common/socket.c | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 1709c9845..5b7e17434 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2007/11/09 + * Fixed socket.c checking time() incorrectly (bugreport:394) [ultramage] * Added a database iterator to db.c/db.h. [FlavioJS] 2007/11/08 * Changed EXIT_SUCCESS back to 0 in console.c to avoid an unnecessary include. diff --git a/src/common/socket.c b/src/common/socket.c index 5fb9ead9e..9907845eb 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -527,8 +527,6 @@ int do_sockets(int next) struct timeval timeout; int ret,i; - last_tick = time(0); - // PRESEND Timers are executed before do_sendrecv and can send packets and/or set sessions to eof. // Send remaining data and process client-side disconnects here. #ifdef SEND_SHORTLIST @@ -561,6 +559,8 @@ int do_sockets(int next) return 0; // interrupted by a signal, just loop and try again } + last_tick = time(NULL); + #ifdef WIN32 // on windows, enumerating all members of the fd_set is way faster if we access the internals for(i=0;i<(int)rfd.fd_count;i++) @@ -1080,7 +1080,7 @@ void socket_init(void) socket_config_read(SOCKET_CONF_FILENAME); // initialise last send-receive tick - last_tick = time(0); + last_tick = time(NULL); // session[0] is now currently used for disconnected sessions of the map server, and as such, // should hold enough buffer (it is a vacuum so to speak) as it is never flushed. [Skotlex] |