From: Joseph Bongaarts Date: Tue, 26 Feb 2002 23:10:39 +0000 (+0000) Subject: Author: Ghostwolf X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=3e21658a6e8c1c716acff1329819d44530fdb865 Author: Ghostwolf Log message: Cosmetic change to head in sand map output, fixed the asserts in map_* and fixed a bug in ms_server that was makeing P10's into J10's git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@660 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ircd/m_server.c b/ircd/m_server.c index b27f7e2..12ecf47 100644 --- a/ircd/m_server.c +++ b/ircd/m_server.c @@ -704,8 +704,6 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) if (strlen(parv[5]) != 3 || (parv[5][0] != 'P' && parv[5][0] != 'J')) return exit_client_msg(cptr, sptr, &me, "Bogus protocol (%s)", parv[5]); - *parv[5] = 'J'; - if (*parv[7] == '+') { for (ch = parv[7] + 1; *ch; ch++) switch (*ch) { diff --git a/ircd/map.c b/ircd/map.c index b931ff7..ea8d147 100644 --- a/ircd/map.c +++ b/ircd/map.c @@ -56,11 +56,11 @@ static struct Map *MapList = 0; /* Add a server to the map list. */ static void map_add(struct Client *server) { -/* assert(server != 0); + struct Map *map = (struct Map *)MyMalloc(sizeof(struct Map)); + + assert(IsServer(server)); assert(!IsHub(server)); assert(!IsService(server)); -*/ - struct Map *map = (struct Map *)MyMalloc(sizeof(struct Map)); map->lasttime = TStime(); strcpy(map->name, cli_name(server)); @@ -78,7 +78,7 @@ static void map_add(struct Client *server) /* Remove a server from the map list */ static void map_remove(struct Map *cptr) { - /* assert(cptr != 0);*/ + assert(cptr != 0); if(cptr->next) cptr->next->prev = cptr->prev; @@ -97,10 +97,10 @@ static void map_remove(struct Map *cptr) * splits, or we haven't checked in more than a week. */ void map_update(struct Client *cptr) { - /* assert(IsServer(cptr)); */ - struct Map *map = 0; - + + assert(IsServer(cptr)); + /* Find the server in the list and update it */ for(map = MapList; map; map = map->next) { @@ -155,7 +155,7 @@ void map_dump_head_in_sand(struct Client *cptr) else map_update(acptr); } - send_reply(cptr, RPL_MAP, "", "|-", map->name, "", map->maxclients); + send_reply(cptr, RPL_MAP, smap ? "|" : "`", "-", map->name, "", map->maxclients); } } diff --git a/ircd/s_misc.c b/ircd/s_misc.c index 021dae6..62a3372 100644 --- a/ircd/s_misc.c +++ b/ircd/s_misc.c @@ -270,9 +270,6 @@ static void exit_one_client(struct Client* bcptr, const char* comment) Count_serverdisconnects(UserStats); else Count_remoteserverquits(UserStats); -#ifdef HEAD_IN_SAND_MAP - map_update(bcptr); -#endif } else if (IsMe(bcptr)) { @@ -481,6 +478,10 @@ int exit_client(struct Client *cptr, /* Connection being handled by cli_serv(victim)->up, victim, comment); } +#ifdef HEAD_IN_SAND_MAP + map_update(victim); +#endif + /* * First generate the needed protocol for the other server links * except the source: