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/map/chrif.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/map/chrif.c')
-rw-r--r-- | src/map/chrif.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index d163dab77..3928c0a7a 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1,12 +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 <string.h> -#include <sys/types.h> -#include <time.h> - #include "../common/cbasetypes.h" #include "../common/malloc.h" #include "../common/socket.h" @@ -16,13 +10,19 @@ #include "map.h" #include "battle.h" -#include "chrif.h" #include "clif.h" #include "intif.h" #include "npc.h" #include "pc.h" #include "status.h" #include "mercenary.h" +#include "chrif.h" + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <time.h> struct dbt *auth_db; @@ -1424,7 +1424,7 @@ int chrif_parse(int fd) if (r == 1) continue; // intifで処理した if (r == 2) return 0; // intifで処理したが、データが足りない - session[fd]->eof = 1; + set_eof(fd); ShowWarning("chrif_parse: session #%d, intif_parse failed -> disconnected.\n", fd); return 0; } @@ -1465,7 +1465,7 @@ int chrif_parse(int fd) default: if (battle_config.error_log) ShowError("chrif_parse : unknown packet (session #%d): 0x%x. Disconnecting.\n", fd, cmd); - session[fd]->eof = 1; + set_eof(fd); return 0; } if (fd == char_fd) //There's the slight chance we lost the connection during parse, in which case this would segfault if not checked [Skotlex] |