summaryrefslogtreecommitdiff
path: root/src/ladmin
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-09 03:18:16 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-09 03:18:16 +0000
commit290fb53feea76f9749e4630ec71552e41afa59de (patch)
tree9caf07f59c86716b5f4105d22b3cb65e89386cf2 /src/ladmin
parent89b8b179b6864e5ce5d8b22a52feac761f66e77c (diff)
downloadhercules-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/ladmin')
-rw-r--r--src/ladmin/ladmin.c44
1 files changed, 22 insertions, 22 deletions
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 <sys/types.h>
#include <time.h>
#ifdef WIN32
@@ -36,17 +47,6 @@ void Gettimeofday(struct timeval *timenow)
#include <fcntl.h>
#include <string.h> // str*
#include <stdarg.h> // valist
-#include <ctype.h> // 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;
}
}