]> jfr.im git - solanum.git/blobdiff - src/scache.c
MyMalloc -> rb_malloc
[solanum.git] / src / scache.c
index c5a7d13f1f5917915af3f3dd88c303d2494371ad..49c9f3b38b1746c34e7347f266e058b4ea42cd8e 100644 (file)
@@ -32,7 +32,6 @@
 #include "numeric.h"
 #include "send.h"
 #include "scache.h"
-#include "memory.h"
 #include "s_conf.h"
 
 
@@ -100,7 +99,7 @@ find_or_add(const char *name)
                        return ptr;
        }
 
-       ptr = (struct scache_entry *) MyMalloc(sizeof(struct scache_entry));
+       ptr = (struct scache_entry *) rb_malloc(sizeof(struct scache_entry));
        s_assert(0 != ptr);
 
        strlcpy(ptr->name, name, sizeof(ptr->name));
@@ -185,6 +184,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