summaryrefslogtreecommitdiff
path: root/src/common/socket.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-27 03:35:57 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-27 03:35:57 +0000
commit1307b441cd2cdc94bdde1999d48aefb55d91e082 (patch)
tree4674edabfa271c4f0dd2b4f21f783640958e8cac /src/common/socket.c
parentdfe4ede046db94e2e6e580d2efa13bb9a773ce15 (diff)
downloadhercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.tar.gz
hercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.tar.bz2
hercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.tar.xz
hercules-1307b441cd2cdc94bdde1999d48aefb55d91e082.zip
* Tweeked the declaration and initialization defines for vectors.
* Made do_sockets leave the for loop as soon as the readable number of sockets returned by select is found. * Made all posix compliant systems that support it and FreeBSD >= 5.1 (implements it but doesn't have the posix defines) use the precise and consistent tick() implementation. * Minor tweek to HEAP_SEARCH (same variable can be used in from and to). * Fixed the map server not exiting when make_listen_bind fails and returns -1. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11983 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/socket.c')
-rw-r--r--src/common/socket.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/socket.c b/src/common/socket.c
index b1c564034..0173ee846 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -716,11 +716,13 @@ int do_sockets(int next)
}
#else
// otherwise assume that the fd_set is a bit-array and enumerate it in a standard way
- //TODO: select() returns the number of readable sockets; use that to exit the fd_max loop faster
- for (i = 1; i < fd_max; i++)
+ for( i = 1; ret && i < fd_max; ++i )
{
if(sFD_ISSET(i,&rfd) && session[i])
+ {
session[i]->func_recv(i);
+ --ret;
+ }
}
#endif