From 290fb53feea76f9749e4630ec71552e41afa59de Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Wed, 9 May 2007 03:18:16 +0000 Subject: * 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 --- src/login/login.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/login') 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 -#include -#include // for stat/lstat/fstat -#include -#include -#include - #include "../common/cbasetypes.h" #include "../common/core.h" #include "../common/socket.h" @@ -22,6 +15,13 @@ #include "../common/md5calc.h" #include "login.h" +#include +#include +#include // for stat/lstat/fstat +#include +#include +#include + 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; } } -- cgit v1.2.3-60-g2f50