diff options
author | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-05-09 03:18:16 +0000 |
---|---|---|
committer | FlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-05-09 03:18:16 +0000 |
commit | 290fb53feea76f9749e4630ec71552e41afa59de (patch) | |
tree | 9caf07f59c86716b5f4105d22b3cb65e89386cf2 /src/login_sql | |
parent | 89b8b179b6864e5ce5d8b22a52feac761f66e77c (diff) | |
download | hercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.gz hercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.bz2 hercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.xz hercules-290fb53feea76f9749e4630ec71552e41afa59de.zip |
* Added Buuyo-Tama's shortlist for send/eof sockets (defined out for now).
* Replaced toupper/tolower in ladmin by TOUPPER/TOLOWER defines.
Shortlist:
It's a list of sockets that have data to send and/or are ready for eof processing.
It aims to reduce the amount of time spent on do_sendrecv, where it was spending ~13.5% of execution time on a server with 1k users at WoE.
thanks to Buuyo-tama for the profile info and code
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10506 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/login_sql')
-rw-r--r-- | src/login_sql/login.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 5929e9748..bad4c8731 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -1,13 +1,6 @@ // Copyright (c) Athena Dev Teams - Licensed under GNU GPL // For more information, see LICENCE in the main folder -#include <stdio.h> -#include <stdlib.h> -#include <sys/stat.h> // for stat/lstat/fstat -#include <signal.h> -#include <fcntl.h> -#include <string.h> - #include "../common/cbasetypes.h" #include "../common/core.h" #include "../common/socket.h" @@ -21,6 +14,13 @@ #include "../common/md5calc.h" #include "login.h" +#include <stdio.h> +#include <stdlib.h> +#include <sys/stat.h> // for stat/lstat/fstat +#include <signal.h> +#include <fcntl.h> +#include <string.h> + //add include for DBMS(mysql) #ifdef WIN32 #include <winsock2.h> @@ -735,7 +735,7 @@ int parse_fromchar(int fd) if (server_fd[id] == fd) break; if (id == MAX_SERVERS) { // not a char server - session[fd]->eof = 1; + set_eof(fd); do_close(fd); return 0; } @@ -1236,7 +1236,7 @@ int parse_fromchar(int fd) default: ShowError("parse_fromchar: Unknown packet 0x%x from a char-server! Disconnecting!\n", RFIFOW(fd,0)); - session[fd]->eof = 1; + set_eof(fd); return 0; } } @@ -1354,7 +1354,7 @@ int parse_login(int fd) WFIFOB(fd,2) = 3; // 3 = Rejected from Server WFIFOSET(fd,23); RFIFOSKIP(fd,packet_len); - session[fd]->eof = 1; + set_eof(fd); break; } @@ -1541,7 +1541,7 @@ int parse_login(int fd) struct login_session_data* ld; if (session[fd]->session_data) { ShowWarning("login: abnormal request of MD5 key (already opened session).\n"); - session[fd]->eof = 1; + set_eof(fd); return 0; } @@ -1655,12 +1655,12 @@ int parse_login(int fd) case 0x7532: // Request to end connection ShowStatus ("End of connection (ip: %s)" RETCODE, ip); - session[fd]->eof = 1; + set_eof(fd); break; default: ShowStatus ("Abnormal end of connection (ip: %s): Unknown packet 0x%x " RETCODE, ip, RFIFOW(fd,0)); - session[fd]->eof = 1; + set_eof(fd); return 0; } } |