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/login.c | |
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/login.c')
-rw-r--r-- | src/login/login.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/login/login.c b/src/login/login.c index 802ab95fe..bc7fc226e 100644 --- a/src/login/login.c +++ b/src/login/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" @@ -22,6 +15,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> + uint32 account_id_count = START_ACCOUNT_NUM; bool new_account_flag = true; uint32 login_ip = INADDR_ANY; @@ -1367,7 +1367,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; } @@ -1946,7 +1946,7 @@ int parse_fromchar(int fd) } } ShowError("parse_fromchar: Unknown packet 0x%x from a char-server! Disconnecting!\n", command); - session[fd]->eof = 1; + set_eof(fd); return 0; } } @@ -2001,7 +2001,7 @@ int parse_admin(int fd) case 0x7532: // Request of end of connection login_log("'ladmin': End of connection (ip: %s)" RETCODE, ip); RFIFOSKIP(fd,2); - session[fd]->eof = 1; + set_eof(fd); break; case 0x7920: // Request of an accounts list @@ -2915,7 +2915,7 @@ int parse_admin(int fd) } } login_log("'ladmin': End of connection, unknown packet (ip: %s)" RETCODE, ip); - session[fd]->eof = 1; + set_eof(fd); ShowWarning("Remote administration has been disconnected (unknown packet).\n"); return 0; } @@ -3012,7 +3012,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; } @@ -3123,7 +3123,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; } @@ -3243,7 +3243,7 @@ int parse_login(int fd) case 0x7532: // Request to end connection login_log("End of connection (ip: %s)" RETCODE, ip); - session[fd]->eof = 1; + set_eof(fd); return 0; case 0x7918: // Request for administation login @@ -3340,7 +3340,7 @@ int parse_login(int fd) } } login_log("Abnormal end of connection (ip: %s): Unknown packet 0x%x " RETCODE, ip, command); - session[fd]->eof = 1; + set_eof(fd); return 0; } } |