diff --git a/include/scache.h b/include/scache.h index ffbffb5..eec241c 100644 --- a/include/scache.h +++ b/include/scache.h @@ -35,6 +35,7 @@ extern struct scache_entry *scache_connect(const char *name, const char *info, i extern void scache_split(struct scache_entry *ptr); extern const char *scache_get_name(struct scache_entry *ptr); extern void scache_send_flattened_links(struct Client *source_p); +extern void scache_send_missing(struct Client *source_p); extern void count_scache(size_t *, size_t *); #endif diff --git a/modules/m_map.c b/modules/m_map.c index aeb7c7f..256e3ad 100644 --- a/modules/m_map.c +++ b/modules/m_map.c @@ -29,6 +29,7 @@ #include "send.h" #include "s_conf.h" #include "sprintf_irc.h" +#include "scache.h" #define USER_COL 50 /* display | Users: %d at col 50 */ @@ -73,6 +74,7 @@ static int mo_map(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { dump_map(client_p, &me, buf); + scache_send_missing(client_p); sendto_one_numeric(client_p, RPL_MAPEND, form_str(RPL_MAPEND)); return 0; diff --git a/src/scache.c b/src/scache.c index c5a7d13..525e5bd 100644 --- a/src/scache.c +++ b/src/scache.c @@ -185,6 +185,33 @@ scache_send_flattened_links(struct Client *source_p) sendto_one_numeric(source_p, RPL_ENDOFLINKS, form_str(RPL_ENDOFLINKS), "*"); } +#define MISSING_TIMEOUT 86400 + +/* scache_send_missing() + * + * inputs - client to send to + * outputs - recently split servers + * side effects - + */ +void +scache_send_missing(struct Client *source_p) +{ + struct scache_entry *scache_ptr; + int i; + + for (i = 0; i < SCACHE_HASH_SIZE; i++) + { + scache_ptr = scache_hash[i]; + while (scache_ptr) + { + if (!(scache_ptr->flags & SC_ONLINE) && scache_ptr->last_split > CurrentTime - MISSING_TIMEOUT) + sendto_one_numeric(source_p, RPL_MAP, "** %s (recently split)", + scache_ptr->name); + + scache_ptr = scache_ptr->next; + } + } +} /* * count_scache * inputs - pointer to where to leave number of servers cached