diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-02-21 13:09:22 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-02-21 13:09:22 +0000 |
commit | 16072af808e7a55a0ba1ad5efc36c747c04456e3 (patch) | |
tree | 287e3b2ee3020064773b3395b019e030fbbbf43a /src | |
parent | bce0ac44c9b5d499de0cc96c89ea54929b3cbc43 (diff) | |
download | hercules-16072af808e7a55a0ba1ad5efc36c747c04456e3.tar.gz hercules-16072af808e7a55a0ba1ad5efc36c747c04456e3.tar.bz2 hercules-16072af808e7a55a0ba1ad5efc36c747c04456e3.tar.xz hercules-16072af808e7a55a0ba1ad5efc36c747c04456e3.zip |
Minor stuff (typos, socket.c, junk in login reply packet)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9886 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r-- | src/common/socket.c | 29 | ||||
-rw-r--r-- | src/login/login.c | 2 | ||||
-rw-r--r-- | src/login_sql/login.c | 2 |
3 files changed, 10 insertions, 23 deletions
diff --git a/src/common/socket.c b/src/common/socket.c index 43422da85..fda81521d 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -589,42 +589,29 @@ int do_sendrecv(int next) if(session[rfd.fd_array[i]]) session[rfd.fd_array[i]]->func_recv(rfd.fd_array[i]); } - +#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++) { - if(!session[i]) - continue; - - if(session[i]->wdata_size) - session[i]->func_send(i); - - if(session[i]->eof) //func_send can't free a session, this is safe. - { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex] - session[i]->func_parse(i); //This should close the session inmediately. - } + if(FD_ISSET(i,&rfd) && session[i]) + session[i]->func_recv(i); } +#endif -#else - // otherwise assume that the fd_set is a bit-array and enumerate it in a standard way for (i = 1; i < fd_max; i++) { if(!session[i]) continue; - if(FD_ISSET(i,&rfd)){ - //ShowMessage("read:%d\n",i); - session[i]->func_recv(i); - } - if(session[i]->wdata_size) session[i]->func_send(i); - - if(session[i]->eof) + + if(session[i]->eof) //func_send can't free a session, this is safe. { //Finally, even if there is no data to parse, connections signalled eof should be closed, so we call parse_func [Skotlex] session[i]->func_parse(i); //This should close the session inmediately. } } -#endif return 0; } diff --git a/src/login/login.c b/src/login/login.c index d3ce7311b..95abd0006 100644 --- a/src/login/login.c +++ b/src/login/login.c @@ -3193,7 +3193,7 @@ int parse_login(int fd) { WFIFOL(fd,8) = account.account_id; WFIFOL(fd,12) = account.login_id2; WFIFOL(fd,16) = 0; // in old version, that was for ip (not more used) - memcpy(WFIFOP(fd,20), account.lastlogin, 24); // in old version, that was for name (not more used) + //memcpy(WFIFOP(fd,20), account.lastlogin, 24); // in old version, that was for name (not more used) WFIFOB(fd,46) = account.sex; WFIFOSET(fd,47+32*server_num); if (auth_fifo_pos >= AUTH_FIFO_SIZE) diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 9c276c835..ad1ce91f5 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -1656,7 +1656,7 @@ int parse_login(int fd) { WFIFOL(fd,8)=account.account_id; WFIFOL(fd,12)=account.login_id2; WFIFOL(fd,16)=0; - memcpy(WFIFOP(fd,20),account.lastlogin,24); + //memcpy(WFIFOP(fd,20),account.lastlogin,24); WFIFOB(fd,46)=account.sex; WFIFOSET(fd,47+32*server_num); if(auth_fifo_pos>=AUTH_FIFO_SIZE) |