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/ladmin/ladmin.c | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'src/ladmin') diff --git a/src/ladmin/ladmin.c b/src/ladmin/ladmin.c index 75512ba24..8312c91a1 100644 --- a/src/ladmin/ladmin.c +++ b/src/ladmin/ladmin.c @@ -7,6 +7,17 @@ // if you modify this software, modify ladmin in tool too. /////////////////////////////////////////////////////////////////////////// +#include "../common/cbasetypes.h" +#include "../common/core.h" +#include "../common/strlib.h" +#include "../common/socket.h" +#include "../common/timer.h" +#include "../common/version.h" +#include "../common/mmo.h" +#include "../common/md5calc.h" +#include "../common/showmsg.h" +#include "ladmin.h" + #include #include #ifdef WIN32 @@ -36,17 +47,6 @@ void Gettimeofday(struct timeval *timenow) #include #include // str* #include // valist -#include // tolower - -#include "../common/core.h" -#include "../common/strlib.h" -#include "../common/socket.h" -#include "../common/timer.h" -#include "../common/version.h" -#include "../common/mmo.h" -#include "../common/md5calc.h" -#include "../common/showmsg.h" -#include "ladmin.h" //-------------------------------INSTRUCTIONS------------------------------ @@ -579,7 +579,7 @@ void display_help(char* param, int language) { // lowercase for command for (i = 0; command[i]; i++) - command[i] = tolower(command[i]); + command[i] = TOLOWER(command[i]); // Analyse of the command check_command(command); // give complete name to the command @@ -1146,7 +1146,7 @@ int addaccount(char* param, int emailflag) { } }*/ - sex[0] = toupper(sex[0]); + sex[0] = TOUPPER(sex[0]); if (strchr("MF", sex[0]) == NULL) { if (defaultlanguage == 'F') { ShowMessage("Sexe incorrect [%s]. Entrez M ou F svp.\n", sex); @@ -1251,7 +1251,7 @@ int banaddaccount(char* param) { // lowercase for modif for (i = 0; modif[i]; i++) - modif[i] = tolower(modif[i]); + modif[i] = TOLOWER(modif[i]); p_modif = modif; while (strlen(p_modif) > 0) { value = atoi(p_modif); @@ -2074,7 +2074,7 @@ int changelanguage(char* language) { return 136; } - language[0] = toupper(language[0]); + language[0] = TOUPPER(language[0]); if (language[0] == 'F' || language[0] == 'E') { defaultlanguage = language[0]; if (defaultlanguage == 'F') { @@ -2115,7 +2115,7 @@ int listaccount(char* param, int type) { // get all accounts = use default } else if (list_type == 2) { // if search for (i = 0; param[i]; i++) - param[i] = tolower(param[i]); + param[i] = TOLOWER(param[i]); // get all accounts = use default } else if (list_type == 3) { // if listban // get all accounts = use default @@ -2355,7 +2355,7 @@ int changesex(char* param) { return 102; } - sex[0] = toupper(sex[0]); + sex[0] = TOUPPER(sex[0]); if (strchr("MF", sex[0]) == NULL) { if (defaultlanguage == 'F') { ShowMessage("Sexe incorrect [%s]. Entrez M ou F svp.\n", sex); @@ -2607,7 +2607,7 @@ int timeaddaccount(char* param) { // lowercase for modif for (i = 0; modif[i]; i++) - modif[i] = tolower(modif[i]); + modif[i] = TOLOWER(modif[i]); p_modif = modif; while (strlen(p_modif) > 0) { value = atoi(p_modif); @@ -3081,7 +3081,7 @@ int prompt(void) { // lowercase for command line for (i = 0; command[i]; i++) - command[i] = tolower(command[i]); + command[i] = TOLOWER(command[i]); if (command[0] == '?' || strlen(command) == 0) { if (defaultlanguage == 'F') { @@ -3250,7 +3250,7 @@ int parse_fromlogin(int fd) ShowMessage(" - unauthorised IP.\n"); ladmin_log("Error at login: incorrect password, administration system not activated, or unauthorised IP." RETCODE); } - session[fd]->eof = 1; + set_eof(fd); //bytes_to_read = 1; // not stop at prompt return 0; } else { @@ -3361,7 +3361,7 @@ int parse_fromlogin(int fd) userid[sizeof(userid)-1] = '\0'; memset(lower_userid, '\0', sizeof(lower_userid)); for (j = 0; userid[j]; j++) - lower_userid[j] = tolower(userid[j]); + lower_userid[j] = TOLOWER(userid[j]); list_first = RFIFOL(fd,i) + 1; // here are checks... if (list_type == 0 || @@ -4148,7 +4148,7 @@ int parse_fromlogin(int fd) default: ShowMessage("Remote administration has been disconnected (unknown packet).\n"); ladmin_log("'End of connection, unknown packet." RETCODE); - session[fd]->eof = 1; + set_eof(fd); return 0; } } -- cgit v1.2.3-60-g2f50