]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_serv.c
ok, trying to work on blockheap's stuff
[irc/rqf/shadowircd.git] / src / s_serv.c
index 47f67fdbe44f04b645129df151dc9cd37530aae8..cd3a90f17a2571a57e9fa65876c9ef6f2619099b 100644 (file)
 #include <openssl/rsa.h>
 #endif
 
-#include "tools.h"
 #include "s_serv.h"
 #include "class.h"
 #include "client.h"
 #include "common.h"
-#include "event.h"
 #include "hash.h"
 #include "irc_string.h"
 #include "sprintf_irc.h"
@@ -44,7 +42,6 @@
 #include "numeric.h"
 #include "packet.h"
 #include "res.h"
-#include "commio.h"
 #include "s_conf.h"
 #include "s_newconf.h"
 #include "s_log.h"
@@ -53,7 +50,6 @@
 #include "scache.h"
 #include "send.h"
 #include "client.h"
-#include "memory.h"
 #include "channel.h"           /* chcap_usage_counts stuff... */
 #include "hook.h"
 #include "msg.h"
@@ -210,7 +206,7 @@ collect_zipstats(void *unused)
        rb_dlink_node *ptr;
        struct Client *target_p;
 
-       DLINK_FOREACH(ptr, serv_list.head)
+       RB_DLINK_FOREACH(ptr, serv_list.head)
        {
                target_p = ptr->data;
                if(IsCapable(target_p, CAP_ZIP))
@@ -218,7 +214,7 @@ collect_zipstats(void *unused)
                        /* only bother if we haven't already got something queued... */
                        if(!target_p->localClient->slinkq)
                        {
-                               target_p->localClient->slinkq = MyMalloc(1);    /* sigh.. */
+                               target_p->localClient->slinkq = rb_malloc(1);   /* sigh.. */
                                target_p->localClient->slinkq[0] = SLINKCMD_ZIPSTATS;
                                target_p->localClient->slinkq_ofs = 0;
                                target_p->localClient->slinkq_len = 1;
@@ -301,7 +297,7 @@ hunt_server(struct Client *client_p, struct Client *source_p,
                {
                        target_p = NULL;
 
-                       DLINK_FOREACH(ptr, global_client_list.head)
+                       RB_DLINK_FOREACH(ptr, global_client_list.head)
                        {
                                if(match(new, ((struct Client *) (ptr->data))->name))
                                {
@@ -358,7 +354,7 @@ try_connections(void *unused)
        int confrq = 0;
        time_t next = 0;
 
-       DLINK_FOREACH(ptr, server_conf_list.head)
+       RB_DLINK_FOREACH(ptr, server_conf_list.head)
        {
                tmp_p = ptr->data;
 
@@ -374,7 +370,7 @@ try_connections(void *unused)
                 * made one successfull connection... [this algorithm is
                 * a bit fuzzy... -- msa >;) ]
                 */
-               if(tmp_p->hold > CurrentTime)
+               if(tmp_p->hold > rb_current_time())
                {
                        if(next > tmp_p->hold || next == 0)
                                next = tmp_p->hold;
@@ -382,7 +378,7 @@ try_connections(void *unused)
                }
 
                confrq = get_con_freq(cltmp);
-               tmp_p->hold = CurrentTime + confrq;
+               tmp_p->hold = rb_current_time() + confrq;
 
                /*
                 * Found a CONNECT config with port specified, scan clients
@@ -453,7 +449,7 @@ check_server(const char *name, struct Client *client_p)
        if(strlen(name) > HOSTLEN)
                return -4;
 
-       DLINK_FOREACH(ptr, server_conf_list.head)
+       RB_DLINK_FOREACH(ptr, server_conf_list.head)
        {
                tmp_p = ptr->data;
 
@@ -566,7 +562,7 @@ burst_modes_TS5(struct Client *client_p, char *chname, rb_dlink_list *list, char
        mp = mbuf;
        pp = pbuf;
 
-       DLINK_FOREACH(ptr, list->head)
+       RB_DLINK_FOREACH(ptr, list->head)
        {
                banptr = ptr->data;
                tlen = strlen(banptr->banstr) + 3;
@@ -617,7 +613,7 @@ burst_modes_TS6(struct Client *client_p, struct Channel *chptr,
                                    me.id, (long) chptr->channelts, chptr->chname, flag);
        t = buf + mlen;
 
-       DLINK_FOREACH(ptr, list->head)
+       RB_DLINK_FOREACH(ptr, list->head)
        {
                banptr = ptr->data;
 
@@ -677,7 +673,7 @@ burst_TS5(struct Client *client_p)
 
        hclientinfo.client = hchaninfo.client = client_p;
 
-       DLINK_FOREACH(ptr, global_client_list.head)
+       RB_DLINK_FOREACH(ptr, global_client_list.head)
        {
                target_p = ptr->data;
 
@@ -712,7 +708,7 @@ burst_TS5(struct Client *client_p)
                call_hook(h_burst_client, &hclientinfo);
        }
 
-       DLINK_FOREACH(ptr, global_channel_list.head)
+       RB_DLINK_FOREACH(ptr, global_channel_list.head)
        {
                chptr = ptr->data;
 
@@ -725,7 +721,7 @@ burst_TS5(struct Client *client_p)
 
                t = buf + mlen;
 
-               DLINK_FOREACH(uptr, chptr->members.head)
+               RB_DLINK_FOREACH(uptr, chptr->members.head)
                {
                        msptr = uptr->data;
 
@@ -809,7 +805,7 @@ burst_TS6(struct Client *client_p)
 
        hclientinfo.client = hchaninfo.client = client_p;
 
-       DLINK_FOREACH(ptr, global_client_list.head)
+       RB_DLINK_FOREACH(ptr, global_client_list.head)
        {
                target_p = ptr->data;
 
@@ -870,7 +866,7 @@ burst_TS6(struct Client *client_p)
                call_hook(h_burst_client, &hclientinfo);
        }
 
-       DLINK_FOREACH(ptr, global_channel_list.head)
+       RB_DLINK_FOREACH(ptr, global_channel_list.head)
        {
                chptr = ptr->data;
 
@@ -883,7 +879,7 @@ burst_TS6(struct Client *client_p)
 
                t = buf + mlen;
 
-               DLINK_FOREACH(uptr, chptr->members.head)
+               RB_DLINK_FOREACH(uptr, chptr->members.head)
                {
                        msptr = uptr->data;
 
@@ -1020,7 +1016,7 @@ server_estab(struct Client *client_p)
        if(client_p->localClient->passwd)
        {
                memset(client_p->localClient->passwd, 0, strlen(client_p->localClient->passwd));
-               MyFree(client_p->localClient->passwd);
+               rb_free(client_p->localClient->passwd);
                client_p->localClient->passwd = NULL;
        }
 
@@ -1083,7 +1079,7 @@ server_estab(struct Client *client_p)
                SetServlink(client_p);
        }
 
-       sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, CurrentTime);
+       sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, rb_current_time());
 
        client_p->servptr = &me;
 
@@ -1111,13 +1107,13 @@ server_estab(struct Client *client_p)
 
        if(client_p->localClient->fullcaps)
        {
-               DupString(client_p->serv->fullcaps, client_p->localClient->fullcaps);
-               MyFree(client_p->localClient->fullcaps);
+               client_p->serv->fullcaps = rb_strdup(client_p->localClient->fullcaps);
+               rb_free(client_p->localClient->fullcaps);
                client_p->localClient->fullcaps = NULL;
        }
 
        client_p->serv->nameinfo = scache_connect(client_p->name, client_p->info, IsHidden(client_p));
-       client_p->localClient->firsttime = CurrentTime;
+       client_p->localClient->firsttime = rb_current_time();
        /* fixing eob timings.. -gnp */
 
        if((rb_dlink_list_length(&lclient_list) + rb_dlink_list_length(&serv_list)) >
@@ -1154,7 +1150,7 @@ server_estab(struct Client *client_p)
         ** need to send different names to different servers
         ** (domain name matching) Send new server to other servers.
         */
-       DLINK_FOREACH(ptr, serv_list.head)
+       RB_DLINK_FOREACH(ptr, serv_list.head)
        {
                target_p = ptr->data;
 
@@ -1203,7 +1199,7 @@ server_estab(struct Client *client_p)
         **    see previous *WARNING*!!! (Also, original inpath
         **    is destroyed...)
         */
-       DLINK_FOREACH(ptr, global_serv_list.head)
+       RB_DLINK_FOREACH(ptr, global_serv_list.head)
        {
                target_p = ptr->data;
 
@@ -1251,7 +1247,7 @@ start_io(struct Client *server)
        int linecount = 0;
        int linelen;
 
-       iobuf = MyMalloc(256);  /* XXX: This seems arbitrary. Perhaps make it IRCD_BUFSIZE? --nenolod */
+       iobuf = rb_malloc(256); /* XXX: This seems arbitrary. Perhaps make it IRCD_BUFSIZE? --nenolod */
 
        if(IsCapable(server, CAP_ZIP))
        {