]> jfr.im git - solanum.git/blobdiff - src/client.c
MyMalloc -> rb_malloc
[solanum.git] / src / client.c
index ef5af5d2e807ac06768bc92568f083f83348ed8e..c2ae48219e579120b1c505cb0ee2d8c4862ccdf7 100644 (file)
 #include "stdinc.h"
 #include "config.h"
 
-#include "tools.h"
 #include "client.h"
 #include "class.h"
 #include "common.h"
-#include "event.h"
 #include "hash.h"
 #include "irc_string.h"
 #include "sprintf_irc.h"
@@ -40,7 +38,6 @@
 #include "numeric.h"
 #include "packet.h"
 #include "s_auth.h"
-#include "commio.h"
 #include "s_conf.h"
 #include "s_newconf.h"
 #include "s_log.h"
 #include "send.h"
 #include "whowas.h"
 #include "s_user.h"
-#include "linebuf.h"
 #include "hash.h"
-#include "memory.h"
 #include "hostmask.h"
-#include "balloc.h"
 #include "listener.h"
 #include "hook.h"
 #include "msg.h"
@@ -229,13 +223,13 @@ free_local_client(struct Client *client_p)
        {
                memset(client_p->localClient->passwd, 0,
                        strlen(client_p->localClient->passwd));
-               MyFree(client_p->localClient->passwd);
+               rb_free(client_p->localClient->passwd);
        }
 
-       MyFree(client_p->localClient->challenge);
-       MyFree(client_p->localClient->fullcaps);
-       MyFree(client_p->localClient->opername);
-       MyFree(client_p->localClient->mangledhost);
+       rb_free(client_p->localClient->challenge);
+       rb_free(client_p->localClient->fullcaps);
+       rb_free(client_p->localClient->opername);
+       rb_free(client_p->localClient->mangledhost);
 
        BlockHeapFree(lclient_heap, client_p->localClient);
        client_p->localClient = NULL;
@@ -797,8 +791,8 @@ release_client_state(struct Client *client_p)
                if(client_p->serv->user != NULL)
                        free_user(client_p->serv->user, client_p);
                if(client_p->serv->fullcaps)
-                       MyFree(client_p->serv->fullcaps);
-               MyFree(client_p->serv);
+                       rb_free(client_p->serv->fullcaps);
+               rb_free(client_p->serv);
        }
 }
 
@@ -1289,7 +1283,7 @@ exit_aborted_clients(void *unused)
                 */
                abt->client->flags &= ~FLAGS_CLOSING;
                exit_client(abt->client, abt->client, &me, abt->notice);
-               MyFree(abt);
+               rb_free(abt);
        }
 }
 
@@ -1307,7 +1301,7 @@ dead_link(struct Client *client_p)
        if(IsDead(client_p) || IsClosing(client_p) || IsMe(client_p))
                return;
 
-       abt = (struct abort_client *) MyMalloc(sizeof(struct abort_client));
+       abt = (struct abort_client *) rb_malloc(sizeof(struct abort_client));
 
        if(client_p->flags & FLAGS_SENDQEX)
                strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
@@ -1894,7 +1888,7 @@ make_server(struct Client *client_p)
 
        if(!serv)
        {
-               serv = (server_t *) MyMalloc(sizeof(server_t));
+               serv = (server_t *) rb_malloc(sizeof(server_t));
                client_p->serv = serv;
        }
        return client_p->serv;
@@ -1915,7 +1909,7 @@ free_user(struct User *user, struct Client *client_p)
        if(--user->refcnt <= 0)
        {
                if(user->away)
-                       MyFree((char *) user->away);
+                       rb_free((char *) user->away);
                /*
                 * sanity check
                 */
@@ -1942,6 +1936,23 @@ free_user(struct User *user, struct Client *client_p)
        }
 }
 
+void\r
+allocate_away(struct Client *client_p)\r
+{\r
+       if(client_p->user->away == NULL)\r
+               client_p->user->away = rb_bh_alloc(away_heap);  \r
+}\r
+\r
+\r
+void\r
+free_away(struct Client *client_p)\r
+{\r
+       if(client_p->user->away != NULL) {\r
+               rb_bh_free(away_heap, client_p->user->away);\r
+               client_p->user->away = NULL;\r
+       }\r
+}
+
 void
 init_uid(void)
 {