1 diff -r a44630997728 Makefile.in
2 --- a/Makefile.in Wed Apr 02 00:10:51 2008 +0200
3 +++ b/Makefile.in Wed Apr 02 04:03:16 2008 +0400
6 #CFLAGS= -DNDEBUG -g -O2 -D"FD_SETSIZE=1024"
8 -SUBDIRS=libratbox modules extensions libcharybdis src tools servlink doc help
9 +SUBDIRS=libratbox modules extensions src tools servlink doc help
10 CLEANDIRS = ${SUBDIRS}
11 RSA_FILES=rsa_respond/README rsa_respond/respond.c rsa_respond/Makefile
13 diff -r a44630997728 configure.ac
14 --- a/configure.ac Wed Apr 02 00:10:51 2008 +0200
15 +++ b/configure.ac Wed Apr 02 04:03:16 2008 +0400
20 - libcharybdis/Makefile \
23 unsupported/Makefile \
24 diff -r a44630997728 extensions/Makefile.in
25 --- a/extensions/Makefile.in Wed Apr 02 00:10:51 2008 +0200
26 +++ b/extensions/Makefile.in Wed Apr 02 04:03:16 2008 +0400
29 IRCDLIBS = @LIBS@ $(SSL_LIBS)
31 -INCLUDES = -I. -I../include -I../libcharybdis -I../libratbox/include $(SSL_INCLUDES)
32 +INCLUDES = -I. -I../include -I../libratbox/include $(SSL_INCLUDES)
33 CPPFLAGS = ${INCLUDES} @CPPFLAGS@
36 diff -r a44630997728 extensions/hurt.c
37 --- a/extensions/hurt.c Wed Apr 02 00:10:51 2008 +0200
38 +++ b/extensions/hurt.c Wed Apr 02 04:03:16 2008 +0400
45 #include "s_newconf.h"
48 typedef struct _hurt_state {
51 - dlink_list hurt_clients;
52 + rb_dlink_list hurt_clients;
54 time_t default_expire;
55 const char *exit_reason;
58 /* {{{ State containers */
60 -dlink_list hurt_confs = { NULL, NULL, 0 };
61 +rb_dlink_list hurt_confs = { NULL, NULL, 0 };
69 - dlink_node *ptr, *next_ptr;
70 + rb_dlink_node *ptr, *next_ptr;
72 /* and delete our events. */
73 rb_event_delete(hurt_expire_ev);
74 rb_event_delete(hurt_check_ev);
76 - DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head)
77 + RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head)
79 - dlinkDestroy(ptr, &hurt_state.hurt_clients);
80 + rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
86 hurt_check_event(void *arg)
88 - dlink_node *ptr, *next_ptr;
89 + rb_dlink_node *ptr, *next_ptr;
90 struct Client *client_p;
92 - DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
93 + RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_state.hurt_clients.head) {
95 if (!EmptyString(client_p->user->suser))
97 - dlinkDestroy(ptr, &hurt_state.hurt_clients);
98 + rb_dlinkDestroy(ptr, &hurt_state.hurt_clients);
99 sendto_one_notice(client_p, ":HURT restriction removed for this session");
100 USED_TARGETS(client_p) = 0;
101 client_p->localClient->target_last = CurrentTime; /* don't ask --nenolod */
102 @@ -414,16 +413,16 @@
104 hurt_expire_event(void *unused)
106 - dlink_node *ptr, *next_ptr;
107 + rb_dlink_node *ptr, *next_ptr;
110 - DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head)
111 + RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head)
113 hurt = (hurt_t *) ptr->data;
115 if (hurt->expire <= CurrentTime)
117 - dlinkFindDestroy(hurt, &hurt_confs);
118 + rb_dlinkFindDestroy(hurt, &hurt_confs);
123 s_assert(data != NULL);
124 s_assert(data->target != NULL);
126 - dlinkFindDestroy(data->target, &hurt_state.hurt_clients);
127 + rb_dlinkFindDestroy(data->target, &hurt_state.hurt_clients);
132 USED_TARGETS(source_p) = 10;
133 source_p->localClient->target_last = CurrentTime + 600; /* don't ask --nenolod */
134 SetTGChange(source_p);
135 - dlinkAddAlloc(source_p, &hurt_state.hurt_clients);
136 + rb_dlinkAddAlloc(source_p, &hurt_state.hurt_clients);
137 sendto_one_notice(source_p, ":You are hurt. Please identify to services immediately, or use /stats p for assistance.");
142 doing_stats_hook(hook_data_int *hdata)
145 + rb_dlink_node *ptr;
147 struct Client *source_p;
153 - DLINK_FOREACH(ptr, hurt_confs.head)
154 + RB_DLINK_FOREACH(ptr, hurt_confs.head)
156 hurt = (hurt_t *) ptr->data;
157 sendto_one_numeric(source_p, RPL_STATSKLINE,
158 @@ -543,10 +542,10 @@
162 - hurt = MyMalloc(sizeof(hurt_t));
163 + hurt = rb_malloc(sizeof(hurt_t));
165 - DupString(hurt->ip, ip);
166 - DupString(hurt->reason, reason);
167 + hurt->ip = rb_strdup(ip);
168 + hurt->reason = rb_strdup(reason);
169 hurt->expire = CurrentTime + expire;
172 @@ -563,25 +562,25 @@
180 + rb_free(h->reason);
186 hurt_add(hurt_t *hurt)
188 - dlinkAddAlloc(hurt, &hurt_confs);
189 + rb_dlinkAddAlloc(hurt, &hurt_confs);
193 hurt_find_exact(const char *ip)
196 + rb_dlink_node *ptr;
199 - DLINK_FOREACH(ptr, hurt_confs.head)
200 + RB_DLINK_FOREACH(ptr, hurt_confs.head)
202 hurt = (hurt_t *) ptr->data;
204 @@ -595,10 +594,10 @@
206 hurt_find(const char *ip)
209 + rb_dlink_node *ptr;
212 - DLINK_FOREACH(ptr, hurt_confs.head)
213 + RB_DLINK_FOREACH(ptr, hurt_confs.head)
215 hurt = (hurt_t *) ptr->data;
219 hurt_t *hurt = hurt_find_exact(ip);
221 - dlinkFindDestroy(hurt, &hurt_confs);
222 + rb_dlinkFindDestroy(hurt, &hurt_confs);
228 heal_nick(struct Client *source_p, struct Client *target_p)
230 - if (dlinkFindDestroy(target_p, &hurt_state.hurt_clients))
231 + if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients))
233 sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s used HEAL on %s",
234 get_oper_name(source_p), get_client_name(target_p, HIDE_IP));
235 diff -r a44630997728 include/cache.h
236 --- a/include/cache.h Wed Apr 02 00:10:51 2008 +0200
237 +++ b/include/cache.h Wed Apr 02 04:03:16 2008 +0400
239 #define INCLUDED_CACHE_H
246 diff -r a44630997728 include/class.h
247 --- a/include/class.h Wed Apr 02 00:10:51 2008 +0200
248 +++ b/include/class.h Wed Apr 02 04:03:16 2008 +0400
251 #ifndef INCLUDED_class_h
252 #define INCLUDED_class_h
258 diff -r a44630997728 include/client.h
259 --- a/include/client.h Wed Apr 02 00:10:51 2008 +0200
260 +++ b/include/client.h Wed Apr 02 04:03:16 2008 +0400
264 #include "ircd_defs.h"
265 -#include "linebuf.h"
269 #include "irc_string.h"
270 #include "sprintf_irc.h"
277 extern void init_uid(void);
278 extern char *generate_uid(void);
280 +void allocate_away(struct Client *);
281 +void free_away(struct Client *);
283 #endif /* INCLUDED_client_h */
284 diff -r a44630997728 include/hash.h
285 --- a/include/hash.h Wed Apr 02 00:10:51 2008 +0200
286 +++ b/include/hash.h Wed Apr 02 04:03:16 2008 +0400
289 #ifndef INCLUDED_hash_h
290 #define INCLUDED_hash_h
296 diff -r a44630997728 include/irc_string.h
297 --- a/include/irc_string.h Wed Apr 02 00:10:51 2008 +0200
298 +++ b/include/irc_string.h Wed Apr 02 04:03:16 2008 +0400
300 size_t strlcat(char *dst, const char *src, size_t siz);
304 -#define DupString(x,y) do { x = strdup(y); if(x == NULL) outofmemory(); } while(0)
306 -#define DupString(x,y) do { x = malloc(strlen(y) + 1); if(x == NULL) outofmemory(); strcpy(x, y); } while(0)
310 #define DupNString(x, y, len) do { x = strndup(y, len); if(x == NULL) outofmemory(); } while (0)
312 diff -r a44630997728 include/ircd.h
313 --- a/include/ircd.h Wed Apr 02 00:10:51 2008 +0200
314 +++ b/include/ircd.h Wed Apr 02 04:03:16 2008 +0400
316 #define INCLUDED_ircd_h
323 struct rb_dlink_list;
325 extern rb_dlink_list global_client_list;
326 extern struct Client *local[];
327 extern struct Counter Count;
329 -extern time_t CurrentTime;
331 extern struct timeval SystemTime;
332 -#define CurrentTime SystemTime.tv_sec
333 extern int default_server_capabs;
335 extern time_t startup_time;
336 diff -r a44630997728 include/modules.h
337 --- a/include/modules.h Wed Apr 02 00:10:51 2008 +0200
338 +++ b/include/modules.h Wed Apr 02 04:03:16 2008 +0400
347 diff -r a44630997728 include/monitor.h
348 --- a/include/monitor.h Wed Apr 02 00:10:51 2008 +0200
349 +++ b/include/monitor.h Wed Apr 02 04:03:16 2008 +0400
351 #ifndef INCLUDED_monitor_h
352 #define INCLUDED_monitor_h
358 struct monitor *hnext;
363 -extern BlockHeap *monitor_heap;
364 +extern struct monitor *monitorTable[];
366 +#define MONITOR_HASH_BITS 16
367 +#define MONITOR_HASH_SIZE (1<<MONITOR_HASH_BITS)
369 -#define MONITOR_HASH_SIZE 65536
370 -#define MONITOR_HASH_BITS 16
371 +void free_monitor(struct monitor *);
373 void init_monitor(void);
374 struct monitor *find_monitor(const char *name, int add);
375 diff -r a44630997728 include/newconf.h
376 --- a/include/newconf.h Wed Apr 02 00:10:51 2008 +0200
377 +++ b/include/newconf.h Wed Apr 02 04:03:16 2008 +0400
386 diff -r a44630997728 include/packet.h
387 --- a/include/packet.h Wed Apr 02 00:10:51 2008 +0200
388 +++ b/include/packet.h Wed Apr 02 04:03:16 2008 +0400
390 #ifndef INCLUDED_packet_h
391 #define INCLUDED_packet_h
396 * this hides in here rather than a config.h because it really shouldn't
397 * be tweaked unless you *REALLY REALLY* know what you're doing!
398 diff -r a44630997728 include/parse.h
399 --- a/include/parse.h Wed Apr 02 00:10:51 2008 +0200
400 +++ b/include/parse.h Wed Apr 02 04:03:16 2008 +0400
402 #define INCLUDED_parse_h_h
404 #include "irc_dictionary.h"
409 diff -r a44630997728 include/res.h
410 --- a/include/res.h Wed Apr 02 00:10:51 2008 +0200
411 +++ b/include/res.h Wed Apr 02 04:03:16 2008 +0400
414 #include "ircd_defs.h"
418 #include "irc_string.h"
419 #include "sprintf_irc.h"
420 diff -r a44630997728 include/s_newconf.h
421 --- a/include/s_newconf.h Wed Apr 02 00:10:51 2008 +0200
422 +++ b/include/s_newconf.h Wed Apr 02 04:03:16 2008 +0400
424 #define INCLUDED_s_newconf_h
429 #ifdef HAVE_LIBCRYPTO
430 #include <openssl/rsa.h>
431 diff -r a44630997728 include/send.h
432 --- a/include/send.h Wed Apr 02 00:10:51 2008 +0200
433 +++ b/include/send.h Wed Apr 02 04:03:16 2008 +0400
435 /* The nasty global also used in s_serv.c for server bursts */
436 extern unsigned long current_serial;
438 +extern void send_pop_queue(struct Client *);
440 extern void send_queued(struct Client *to);
442 extern void send_queued_slink_write(int fd, void *data);
443 diff -r a44630997728 include/stdinc.h
444 --- a/include/stdinc.h Wed Apr 02 00:10:51 2008 +0200
445 +++ b/include/stdinc.h Wed Apr 02 04:03:16 2008 +0400
448 #include "ratbox_lib.h"
449 #include "config.h" /* Gotta pull in the autoconf stuff */
450 +#include "ircd_defs.h" /* Needed for some reasons here -- dwr */
452 /* AIX requires this to be the first thing in the file. */
454 diff -r a44630997728 include/substitution.h
455 --- a/include/substitution.h Wed Apr 02 00:10:51 2008 +0200
456 +++ b/include/substitution.h Wed Apr 02 04:03:16 2008 +0400
463 #ifndef SUBSTITUTION_H
464 #define SUBSTITUTION_H
465 diff -r a44630997728 modules/Makefile.in
466 --- a/modules/Makefile.in Wed Apr 02 00:10:51 2008 +0200
467 +++ b/modules/Makefile.in Wed Apr 02 04:03:16 2008 +0400
469 # Change this later! -- adrian
470 automoduledir = @moduledir@/autoload
472 -INCLUDES = -I../include -I../libcharybdis -I../libratbox/include $(SSL_INCLUDES)
473 +INCLUDES = -I../include -I../libratbox/include $(SSL_INCLUDES)
474 CPPFLAGS = ${INCLUDES} @CPPFLAGS@
477 diff -r a44630997728 modules/core/m_die.c
478 --- a/modules/core/m_die.c Wed Apr 02 00:10:51 2008 +0200
479 +++ b/modules/core/m_die.c Wed Apr 02 04:03:16 2008 +0400
487 #include "irc_string.h"
493 diff -r a44630997728 modules/core/m_error.c
494 --- a/modules/core/m_error.c Wed Apr 02 00:10:51 2008 +0200
495 +++ b/modules/core/m_error.c Wed Apr 02 04:03:16 2008 +0400
504 diff -r a44630997728 modules/core/m_join.c
505 --- a/modules/core/m_join.c Wed Apr 02 00:10:51 2008 +0200
506 +++ b/modules/core/m_join.c Wed Apr 02 04:03:16 2008 +0400
516 sendto_one(source_p, form_str(ERR_TOOMANYCHANNELS),
517 me.name, source_p->name, name);
518 if(successful_join_count)
519 - source_p->localClient->last_join_time = CurrentTime;
520 + source_p->localClient->last_join_time = rb_current_time();
524 @@ -304,10 +303,10 @@
525 /* add the user to the channel */
526 add_user_to_channel(chptr, source_p, flags);
527 if (chptr->mode.join_num &&
528 - CurrentTime - chptr->join_delta >= chptr->mode.join_time)
529 + rb_current_time() - chptr->join_delta >= chptr->mode.join_time)
531 chptr->join_count = 0;
532 - chptr->join_delta = CurrentTime;
533 + chptr->join_delta = rb_current_time();
538 /* its a new channel, set +nt and burst. */
539 if(flags & CHFL_CHANOP)
541 - chptr->channelts = CurrentTime;
542 + chptr->channelts = rb_current_time();
543 chptr->mode.mode |= MODE_TOPICLIMIT;
544 chptr->mode.mode |= MODE_NOPRIVMSGS;
547 channel_member_names(chptr, source_p, 1);
549 if(successful_join_count)
550 - source_p->localClient->last_join_time = CurrentTime;
551 + source_p->localClient->last_join_time = rb_current_time();
553 hook_info.client = source_p;
554 hook_info.chptr = chptr;
555 @@ -495,10 +494,10 @@
557 add_user_to_channel(chptr, source_p, CHFL_PEON);
558 if (chptr->mode.join_num &&
559 - CurrentTime - chptr->join_delta >= chptr->mode.join_time)
560 + rb_current_time() - chptr->join_delta >= chptr->mode.join_time)
562 chptr->join_count = 0;
563 - chptr->join_delta = CurrentTime;
564 + chptr->join_delta = rb_current_time();
567 sendto_channel_local(ALL_MEMBERS, chptr, ":%s!%s@%s JOIN :%s",
568 diff -r a44630997728 modules/core/m_kick.c
569 --- a/modules/core/m_kick.c Wed Apr 02 00:10:51 2008 +0200
570 +++ b/modules/core/m_kick.c Wed Apr 02 04:03:16 2008 +0400
578 #include "irc_string.h"
579 diff -r a44630997728 modules/core/m_message.c
580 --- a/modules/core/m_message.c Wed Apr 02 00:10:51 2008 +0200
581 +++ b/modules/core/m_message.c Wed Apr 02 04:03:16 2008 +0400
587 #include "s_newconf.h"
592 /* idle time shouldnt be reset by notices --fl */
594 - source_p->localClient->last = CurrentTime;
595 + source_p->localClient->last = rb_current_time();
598 if(chptr->mode.mode & MODE_NOCOLOR)
601 /* idletime shouldnt be reset by notice --fl */
603 - source_p->localClient->last = CurrentTime;
604 + source_p->localClient->last = rb_current_time();
607 sendto_channel_flags(client_p, type, source_p, chptr, "%s %c%s :%s",
608 @@ -552,12 +551,12 @@
612 - if(target->expiry < CurrentTime)
613 + if(target->expiry < rb_current_time())
615 rb_dlinkDelete(ptr, &tgchange_list);
616 rb_patricia_remove(tgchange_tree, target->pnode);
617 - MyFree(target->ip);
619 + rb_free(target->ip);
626 * XXX: is this controversial?
628 - if(source_p->localClient->target_last > CurrentTime && IsOper(target_p))
629 + if(source_p->localClient->target_last > rb_current_time() && IsOper(target_p))
632 hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32);
633 @@ -598,17 +597,17 @@
634 if(!IsTGChange(source_p))
636 SetTGChange(source_p);
637 - source_p->localClient->target_last = CurrentTime;
638 + source_p->localClient->target_last = rb_current_time();
640 /* clear as many targets as we can */
641 - else if((i = (CurrentTime - source_p->localClient->target_last) / 60))
642 + else if((i = (rb_current_time() - source_p->localClient->target_last) / 60))
644 if(i > USED_TARGETS(source_p))
645 USED_TARGETS(source_p) = 0;
647 USED_TARGETS(source_p) -= i;
649 - source_p->localClient->target_last = CurrentTime;
650 + source_p->localClient->target_last = rb_current_time();
652 /* cant clear any, full target list */
653 else if(USED_TARGETS(source_p) == 10)
658 - source_p->localClient->target_last = CurrentTime;
659 + source_p->localClient->target_last = rb_current_time();
660 SetTGChange(source_p);
664 /* reset idle time for message only if its not to self
665 * and its not a notice */
667 - source_p->localClient->last = CurrentTime;
668 + source_p->localClient->last = rb_current_time();
670 /* target change stuff, dont limit ctcp replies as that
671 * would allow people to start filling up random users
675 if((target_p->localClient->last_caller_id_time +
676 - ConfigFileEntry.caller_id_wait) < CurrentTime)
677 + ConfigFileEntry.caller_id_wait) < rb_current_time())
680 sendto_one_numeric(source_p, RPL_TARGNOTIFY,
682 me.name, target_p->name, source_p->name,
683 source_p->username, source_p->host);
685 - target_p->localClient->last_caller_id_time = CurrentTime;
686 + target_p->localClient->last_caller_id_time = rb_current_time();
688 /* Only so opers can watch for floods */
689 (void) flood_attack_client(p_or_n, source_p, target_p);
690 @@ -769,11 +768,11 @@
692 if(GlobalSetOptions.floodcount && MyConnect(target_p) && IsClient(source_p))
694 - if((target_p->localClient->first_received_message_time + 1) < CurrentTime)
695 + if((target_p->localClient->first_received_message_time + 1) < rb_current_time())
697 - delta = CurrentTime - target_p->localClient->first_received_message_time;
698 + delta = rb_current_time() - target_p->localClient->first_received_message_time;
699 target_p->localClient->received_number_of_privmsgs -= delta;
700 - target_p->localClient->first_received_message_time = CurrentTime;
701 + target_p->localClient->first_received_message_time = rb_current_time();
702 if(target_p->localClient->received_number_of_privmsgs <= 0)
704 target_p->localClient->received_number_of_privmsgs = 0;
705 @@ -824,11 +823,11 @@
707 if(GlobalSetOptions.floodcount && MyClient(source_p))
709 - if((chptr->first_received_message_time + 1) < CurrentTime)
710 + if((chptr->first_received_message_time + 1) < rb_current_time())
712 - delta = CurrentTime - chptr->first_received_message_time;
713 + delta = rb_current_time() - chptr->first_received_message_time;
714 chptr->received_number_of_privmsgs -= delta;
715 - chptr->first_received_message_time = CurrentTime;
716 + chptr->first_received_message_time = rb_current_time();
717 if(chptr->received_number_of_privmsgs <= 0)
719 chptr->received_number_of_privmsgs = 0;
720 diff -r a44630997728 modules/core/m_mode.c
721 --- a/modules/core/m_mode.c Wed Apr 02 00:10:51 2008 +0200
722 +++ b/modules/core/m_mode.c Wed Apr 02 04:03:16 2008 +0400
732 diff -r a44630997728 modules/core/m_nick.c
733 --- a/modules/core/m_nick.c Wed Apr 02 00:10:51 2008 +0200
734 +++ b/modules/core/m_nick.c Wed Apr 02 04:03:16 2008 +0400
736 char note[NICKLEN + 10];
738 /* This had to be copied here to avoid problems.. */
739 - source_p->tsinfo = CurrentTime;
740 + source_p->tsinfo = rb_current_time();
741 if(source_p->name[0])
742 del_from_client_hash(source_p->name, source_p);
744 @@ -774,10 +774,10 @@
745 nick, chptr->chname);
748 - if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < CurrentTime)
749 + if((source_p->localClient->last_nick_change + ConfigFileEntry.max_nick_time) < rb_current_time())
750 source_p->localClient->number_of_nick_changes = 0;
752 - source_p->localClient->last_nick_change = CurrentTime;
753 + source_p->localClient->last_nick_change = rb_current_time();
754 source_p->localClient->number_of_nick_changes++;
756 if(ConfigFileEntry.anti_nick_flood && !IsOper(source_p) &&
757 @@ -796,10 +796,10 @@
760 /* force the TS to increase -- jilles */
761 - if (source_p->tsinfo >= CurrentTime)
762 + if (source_p->tsinfo >= rb_current_time())
765 - source_p->tsinfo = CurrentTime;
766 + source_p->tsinfo = rb_current_time();
767 monitor_signoff(source_p);
768 /* we only do bancache for local users -- jilles */
771 /* client changing their nick - dont reset ts if its same */
774 - source_p->tsinfo = newts ? newts : CurrentTime;
775 + source_p->tsinfo = newts ? newts : rb_current_time();
776 monitor_signoff(source_p);
779 diff -r a44630997728 modules/core/m_part.c
780 --- a/modules/core/m_part.c Wed Apr 02 00:10:51 2008 +0200
781 +++ b/modules/core/m_part.c Wed Apr 02 04:03:16 2008 +0400
791 if(reason[0] && (is_chanop(msptr) || !MyConnect(source_p) ||
792 ((can_send(chptr, source_p, msptr) > 0 &&
793 (source_p->localClient->firsttime +
794 - ConfigFileEntry.anti_spam_exit_message_time) < CurrentTime))))
795 + ConfigFileEntry.anti_spam_exit_message_time) < rb_current_time()))))
797 sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
798 ":%s PART %s :%s", use_id(source_p), chptr->chname, reason);
799 diff -r a44630997728 modules/core/m_quit.c
800 --- a/modules/core/m_quit.c Wed Apr 02 00:10:51 2008 +0200
801 +++ b/modules/core/m_quit.c Wed Apr 02 04:03:16 2008 +0400
804 if(!IsOper(source_p) &&
805 (source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) >
809 exit_client(client_p, source_p, source_p, "Client Quit");
811 diff -r a44630997728 modules/core/m_server.c
812 --- a/modules/core/m_server.c Wed Apr 02 00:10:51 2008 +0200
813 +++ b/modules/core/m_server.c Wed Apr 02 04:03:16 2008 +0400
819 #include "client.h" /* client struct */
820 #include "common.h" /* TRUE bleah */
822 #include "hash.h" /* add_to_client_hash */
823 #include "irc_string.h"
824 #include "ircd.h" /* me */
825 diff -r a44630997728 modules/core/m_sjoin.c
826 --- a/modules/core/m_sjoin.c Wed Apr 02 00:10:51 2008 +0200
827 +++ b/modules/core/m_sjoin.c Wed Apr 02 04:03:16 2008 +0400
836 diff -r a44630997728 modules/m_admin.c
837 --- a/modules/m_admin.c Wed Apr 02 00:10:51 2008 +0200
838 +++ b/modules/m_admin.c Wed Apr 02 04:03:16 2008 +0400
841 static time_t last_used = 0L;
843 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
844 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
846 sendto_one(source_p, form_str(RPL_LOAD2HI),
852 - last_used = CurrentTime;
853 + last_used = rb_current_time();
861 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
862 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
864 sendto_one(source_p, form_str(RPL_LOAD2HI),
865 me.name, source_p->name, "ADMIN");
869 - last_used = CurrentTime;
870 + last_used = rb_current_time();
872 if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME)
874 diff -r a44630997728 modules/m_away.c
875 --- a/modules/m_away.c Wed Apr 02 00:10:51 2008 +0200
876 +++ b/modules/m_away.c Wed Apr 02 04:03:17 2008 +0400
879 m_away(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
884 - if(MyClient(source_p) && !IsFloodDone(source_p))
885 - flood_endgrace(source_p);
887 - if(!IsClient(source_p))
890 - away = source_p->user->away;
892 - if(parc < 2 || EmptyString(parv[1]))
894 - /* Marking as not away */
897 - /* we now send this only if they were away before --is */
898 - sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
899 - ":%s AWAY", use_id(source_p));
900 - sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
901 - ":%s AWAY", source_p->name);
903 - source_p->user->away = NULL;
905 - if(MyConnect(source_p))
906 - sendto_one_numeric(source_p, RPL_UNAWAY, form_str(RPL_UNAWAY));
910 - /* Marking as away */
912 - if(MyConnect(source_p))
914 - if(!IsOper(source_p) &&
915 - (CurrentTime - source_p->localClient->last_away) < ConfigFileEntry.pace_wait)
917 - sendto_one(source_p, form_str(RPL_LOAD2HI),
918 - me.name, source_p->name, "AWAY");
922 - source_p->localClient->last_away = CurrentTime;
925 - awy2 = LOCAL_COPY(parv[1]);
926 - if(strlen(awy2) > AWAYLEN)
927 - awy2[AWAYLEN] = '\0';
929 - /* we now send this only if they weren't away already --is */
932 - sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
933 - ":%s AWAY :%s", use_id(source_p), awy2);
934 - sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
935 - ":%s AWAY :%s", source_p->name, awy2);
940 - DupString(away, awy2);
942 - source_p->user->away = away;
944 - if(MyConnect(source_p))
945 - sendto_one_numeric(source_p, RPL_NOWAWAY, form_str(RPL_NOWAWAY));
947 + if(MyClient(source_p) && !IsFloodDone(source_p))
948 + flood_endgrace(source_p);
950 + if(!IsClient(source_p))
953 + if(parc < 2 || EmptyString(parv[1]))
955 + /* Marking as not away */
956 + if(source_p->user->away != NULL)
958 + /* we now send this only if they were away before --is */
959 + sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
960 + ":%s AWAY", use_id(source_p));
961 + sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
962 + ":%s AWAY", source_p->name);
963 + free_away(source_p);
965 + if(MyConnect(source_p))
966 + sendto_one(source_p, form_str(RPL_UNAWAY),
967 + me.name, source_p->name);
972 + if(source_p->user->away == NULL)
974 + allocate_away(source_p);
975 + rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);
976 + sendto_server(client_p, NULL, CAP_TS6, NOCAPS,
977 + ":%s AWAY :%s", use_id(source_p), source_p->user->away);
978 + sendto_server(client_p, NULL, NOCAPS, CAP_TS6,
979 + ":%s AWAY :%s", source_p->name, source_p->user->away);
982 + rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);
985 + if(MyConnect(source_p))
986 + sendto_one(source_p, form_str(RPL_NOWAWAY), me.name, source_p->name);
990 diff -r a44630997728 modules/m_cap.c
991 --- a/modules/m_cap.c Wed Apr 02 00:10:51 2008 +0200
992 +++ b/modules/m_cap.c Wed Apr 02 04:03:17 2008 +0400
1000 #include "irc_string.h"
1001 diff -r a44630997728 modules/m_capab.c
1002 --- a/modules/m_capab.c Wed Apr 02 00:10:51 2008 +0200
1003 +++ b/modules/m_capab.c Wed Apr 02 04:03:17 2008 +0400
1006 client_p->localClient->caps |= CAP_CAP;
1008 - MyFree(client_p->localClient->fullcaps);
1009 - DupString(client_p->localClient->fullcaps, parv[1]);
1010 + rb_free(client_p->localClient->fullcaps);
1011 + client_p->localClient->fullcaps = rb_strdup(parv[1]);
1013 for (i = 1; i < parc; i++)
1015 @@ -116,10 +116,10 @@
1016 if(!EmptyString(source_p->serv->fullcaps))
1018 source_p->serv->caps = 0;
1019 - MyFree(source_p->serv->fullcaps);
1020 + rb_free(source_p->serv->fullcaps);
1023 - DupString(source_p->serv->fullcaps, parv[1]);
1024 + source_p->serv->fullcaps = rb_strdup(parv[1]);
1026 for (s = strtoken(&p, t, " "); s; s = strtoken(&p, NULL, " "))
1028 diff -r a44630997728 modules/m_challenge.c
1029 --- a/modules/m_challenge.c Wed Apr 02 00:10:51 2008 +0200
1030 +++ b/modules/m_challenge.c Wed Apr 02 04:03:17 2008 +0400
1032 #include <openssl/err.h>
1035 -#include "memory.h"
1038 #include "modules.h"
1040 if(target_p->localClient == NULL)
1043 - MyFree(target_p->localClient->challenge);
1044 - MyFree(target_p->localClient->opername);
1045 + rb_free(target_p->localClient->challenge);
1046 + rb_free(target_p->localClient->opername);
1047 target_p->localClient->challenge = NULL;
1048 target_p->localClient->opername = NULL;
1049 target_p->localClient->chal_time = 0;
1051 if(!source_p->localClient->challenge)
1054 - if((CurrentTime - source_p->localClient->chal_time) > CHALLENGE_EXPIRES)
1055 + if((rb_current_time() - source_p->localClient->chal_time) > CHALLENGE_EXPIRES)
1057 sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), me.name, source_p->name);
1058 ilog(L_FOPER, "EXPIRED CHALLENGE (%s) by (%s!%s@%s) (%s)",
1059 @@ -161,12 +160,12 @@
1060 source_p->name, source_p->username,
1063 - MyFree(b_response);
1064 + rb_free(b_response);
1065 cleanup_challenge(source_p);
1069 - MyFree(b_response);
1070 + rb_free(b_response);
1072 oper_p = find_oper_conf(source_p->username, source_p->orighost,
1075 if(!generate_challenge(&challenge, &(source_p->localClient->challenge), oper_p->rsa_pubkey))
1077 char *chal = challenge;
1078 - source_p->localClient->chal_time = CurrentTime;
1079 + source_p->localClient->chal_time = rb_current_time();
1082 cnt = strlcpy(chal_line, chal, CHALLENGE_WIDTH);
1085 sendto_one(source_p, form_str(RPL_ENDOFRSACHALLENGE2),
1086 me.name, source_p->name);
1087 - MyFree(challenge);
1088 - DupString(source_p->localClient->opername, oper_p->name);
1089 + rb_free(challenge);
1090 + source_p->localClient->opername = rb_strdup(oper_p->name);
1093 sendto_one_notice(source_p, ":Failed to generate challenge.");
1094 @@ -287,21 +286,21 @@
1097 SHA1_Update(&ctx, (u_int8_t *)secret, CHALLENGE_SECRET_LENGTH);
1098 - *r_response = MyMalloc(SHA_DIGEST_LENGTH);
1099 + *r_response = rb_malloc(SHA_DIGEST_LENGTH);
1100 SHA1_Final((u_int8_t *)*r_response, &ctx);
1102 length = RSA_size(rsa);
1103 - tmp = MyMalloc(length);
1104 + tmp = rb_malloc(length);
1105 ret = RSA_public_encrypt(CHALLENGE_SECRET_LENGTH, secret, tmp, rsa, RSA_PKCS1_OAEP_PADDING);
1109 *r_challenge = (char *)ircd_base64_encode(tmp, ret);
1115 - MyFree(*r_response);
1117 + rb_free(*r_response);
1121 diff -r a44630997728 modules/m_chghost.c
1122 --- a/modules/m_chghost.c Wed Apr 02 00:10:51 2008 +0200
1123 +++ b/modules/m_chghost.c Wed Apr 02 04:03:17 2008 +0400
1130 #include "channel.h"
1135 #include "numeric.h"
1136 -#include "memory.h"
1138 #include "s_newconf.h"
1140 diff -r a44630997728 modules/m_close.c
1141 --- a/modules/m_close.c Wed Apr 02 00:10:51 2008 +0200
1142 +++ b/modules/m_close.c Wed Apr 02 04:03:17 2008 +0400
1150 #include "numeric.h"
1151 -#include "commio.h"
1155 diff -r a44630997728 modules/m_cmessage.c
1156 --- a/modules/m_cmessage.c Wed Apr 02 00:10:51 2008 +0200
1157 +++ b/modules/m_cmessage.c Wed Apr 02 04:03:17 2008 +0400
1159 form_str(ERR_TARGUMODEG), target_p->name);
1161 if((target_p->localClient->last_caller_id_time +
1162 - ConfigFileEntry.caller_id_wait) < CurrentTime)
1163 + ConfigFileEntry.caller_id_wait) < rb_current_time())
1165 if(p_or_n != NOTICE)
1166 sendto_one_numeric(source_p, RPL_TARGNOTIFY,
1167 @@ -154,14 +154,14 @@
1168 me.name, target_p->name, source_p->name,
1169 source_p->username, source_p->host);
1171 - target_p->localClient->last_caller_id_time = CurrentTime;
1172 + target_p->localClient->last_caller_id_time = rb_current_time();
1178 if(p_or_n != NOTICE)
1179 - source_p->localClient->last = CurrentTime;
1180 + source_p->localClient->last = rb_current_time();
1182 sendto_anywhere(target_p, source_p, command, ":%s", parv[3]);
1184 diff -r a44630997728 modules/m_connect.c
1185 --- a/modules/m_connect.c Wed Apr 02 00:10:51 2008 +0200
1186 +++ b/modules/m_connect.c Wed Apr 02 04:03:17 2008 +0400
1189 #include "irc_string.h"
1190 #include "numeric.h"
1191 -#include "commio.h"
1193 #include "s_newconf.h"
1195 diff -r a44630997728 modules/m_dline.c
1196 --- a/modules/m_dline.c Wed Apr 02 00:10:51 2008 +0200
1197 +++ b/modules/m_dline.c Wed Apr 02 04:03:17 2008 +0400
1203 #include "channel.h"
1208 #include "hostmask.h"
1209 #include "numeric.h"
1210 -#include "commio.h"
1212 #include "s_newconf.h"
1216 aconf = make_conf();
1217 aconf->status = CONF_DLINE;
1218 - DupString(aconf->host, dlhost);
1219 + aconf->host = rb_strdup(dlhost);
1221 /* Look for an oper reason */
1222 if((oper_reason = strchr(reason, '|')) != NULL)
1226 if(!EmptyString(oper_reason))
1227 - DupString(aconf->spasswd, oper_reason);
1228 + aconf->spasswd = rb_strdup(oper_reason);
1233 rb_snprintf(dlbuffer, sizeof(dlbuffer),
1234 "Temporary D-line %d min. - %s (%s)",
1235 (int) (tdline_time / 60), reason, current_date);
1236 - DupString(aconf->passwd, dlbuffer);
1237 - aconf->hold = CurrentTime + tdline_time;
1238 + aconf->passwd = rb_strdup(dlbuffer);
1239 + aconf->hold = rb_current_time() + tdline_time;
1240 add_temp_dline(aconf);
1242 if(EmptyString(oper_reason))
1246 rb_snprintf(dlbuffer, sizeof(dlbuffer), "%s (%s)", reason, current_date);
1247 - DupString(aconf->passwd, dlbuffer);
1248 + aconf->passwd = rb_strdup(dlbuffer);
1249 add_conf_by_address(aconf->host, CONF_DLINE, NULL, aconf);
1250 write_confitem(DLINE_TYPE, source_p, NULL, aconf->host, reason,
1251 oper_reason, current_date, 0);
1252 diff -r a44630997728 modules/m_encap.c
1253 --- a/modules/m_encap.c Wed Apr 02 00:10:51 2008 +0200
1254 +++ b/modules/m_encap.c Wed Apr 02 04:03:17 2008 +0400
1261 #include "channel.h"
1266 #include "numeric.h"
1267 -#include "memory.h"
1271 diff -r a44630997728 modules/m_etrace.c
1272 --- a/modules/m_etrace.c Wed Apr 02 00:10:51 2008 +0200
1273 +++ b/modules/m_etrace.c Wed Apr 02 04:03:17 2008 +0400
1275 #include "irc_string.h"
1277 #include "numeric.h"
1278 -#include "commio.h"
1281 #include "s_newconf.h"
1282 diff -r a44630997728 modules/m_gline.c
1283 --- a/modules/m_gline.c Wed Apr 02 00:10:51 2008 +0200
1284 +++ b/modules/m_gline.c Wed Apr 02 04:03:17 2008 +0400
1290 #include "s_gline.h"
1291 #include "channel.h"
1295 #include "hostmask.h"
1296 #include "numeric.h"
1297 -#include "commio.h"
1299 #include "s_newconf.h"
1301 @@ -556,15 +554,15 @@
1304 if(!EmptyString(oper_reason))
1305 - DupString(aconf->spasswd, oper_reason);
1306 + aconf->spasswd = rb_strdup(oper_reason);
1309 rb_snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
1311 - DupString(aconf->passwd, buffer);
1312 - DupString(aconf->user, user);
1313 - DupString(aconf->host, host);
1314 - aconf->hold = CurrentTime + ConfigFileEntry.gline_time;
1315 + aconf->passwd = rb_strdup(buffer);
1316 + aconf->user = rb_strdup(user);
1317 + aconf->host = rb_strdup(host);
1318 + aconf->hold = rb_current_time() + ConfigFileEntry.gline_time;
1321 sendto_realops_snomask(SNO_GENERAL, L_ALL,
1322 @@ -651,10 +649,10 @@
1323 sizeof(pending->oper_user2));
1324 strlcpy(pending->oper_host2, source_p->host,
1325 sizeof(pending->oper_host2));
1326 - DupString(pending->reason2, reason);
1327 + pending->reason2 = rb_strdup(reason);
1328 pending->oper_server2 = scache_get_name(source_p->servptr->serv->nameinfo);
1329 - pending->last_gline_time = CurrentTime;
1330 - pending->time_request2 = CurrentTime;
1331 + pending->last_gline_time = rb_current_time();
1332 + pending->time_request2 = rb_current_time();
1338 /* no pending gline, create a new one */
1339 pending = (struct gline_pending *)
1340 - MyMalloc(sizeof(struct gline_pending));
1341 + rb_malloc(sizeof(struct gline_pending));
1343 strlcpy(pending->oper_nick1, source_p->name,
1344 sizeof(pending->oper_nick1));
1345 @@ -675,11 +673,11 @@
1347 strlcpy(pending->user, user, sizeof(pending->user));
1348 strlcpy(pending->host, host, sizeof(pending->host));
1349 - DupString(pending->reason1, reason);
1350 + pending->reason1 = rb_strdup(reason);
1351 pending->reason2 = NULL;
1353 - pending->last_gline_time = CurrentTime;
1354 - pending->time_request1 = CurrentTime;
1355 + pending->last_gline_time = rb_current_time();
1356 + pending->time_request1 = rb_current_time();
1358 rb_dlinkAddAlloc(pending, &pending_glines);
1360 diff -r a44630997728 modules/m_info.c
1361 --- a/modules/m_info.c Wed Apr 02 00:10:51 2008 +0200
1362 +++ b/modules/m_info.c Wed Apr 02 04:03:17 2008 +0400
1369 #include "channel.h"
1373 static time_t last_used = 0L;
1375 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
1376 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
1378 /* safe enough to give this on a local connect only */
1379 sendto_one(source_p, form_str(RPL_LOAD2HI),
1384 - last_used = CurrentTime;
1385 + last_used = rb_current_time();
1387 if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME)
1389 diff -r a44630997728 modules/m_invite.c
1390 --- a/modules/m_invite.c Wed Apr 02 00:10:51 2008 +0200
1391 +++ b/modules/m_invite.c Wed Apr 02 04:03:17 2008 +0400
1398 #include "channel.h"
1400 diff -r a44630997728 modules/m_kline.c
1401 --- a/modules/m_kline.c Wed Apr 02 00:10:51 2008 +0200
1402 +++ b/modules/m_kline.c Wed Apr 02 04:03:17 2008 +0400
1408 #include "channel.h"
1413 #include "hostmask.h"
1414 #include "numeric.h"
1415 -#include "commio.h"
1417 #include "s_newconf.h"
1422 #include "modules.h"
1426 static int mo_kline(struct Client *, struct Client *, int, const char **);
1428 current_date = smalldate();
1429 aconf = make_conf();
1430 aconf->status = CONF_KILL;
1431 - DupString(aconf->host, host);
1432 - DupString(aconf->user, user);
1433 + aconf->host = rb_strdup(host);
1434 + aconf->user = rb_strdup(user);
1437 /* Look for an oper reason */
1441 if(!EmptyString(oper_reason))
1442 - DupString(aconf->spasswd, oper_reason);
1443 + aconf->spasswd = rb_strdup(oper_reason);
1447 @@ -200,13 +197,13 @@
1448 rb_snprintf(buffer, sizeof(buffer),
1449 "Temporary K-line %d min. - %s (%s)",
1450 (int) (tkline_time / 60), reason, current_date);
1451 - DupString(aconf->passwd, buffer);
1452 + aconf->passwd = rb_strdup(buffer);
1453 apply_tkline(source_p, aconf, reason, oper_reason, current_date, tkline_time);
1457 rb_snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
1458 - DupString(aconf->passwd, buffer);
1459 + aconf->passwd = rb_strdup(buffer);
1460 apply_kline(source_p, aconf, reason, oper_reason, current_date);
1464 aconf = make_conf();
1466 aconf->status = CONF_KILL;
1467 - DupString(aconf->user, user);
1468 - DupString(aconf->host, host);
1469 + aconf->user = rb_strdup(user);
1470 + aconf->host = rb_strdup(host);
1472 /* Look for an oper reason */
1473 if((oper_reason = strchr(reason, '|')) != NULL)
1477 if(!EmptyString(oper_reason))
1478 - DupString(aconf->spasswd, oper_reason);
1479 + aconf->spasswd = rb_strdup(oper_reason);
1482 current_date = smalldate();
1483 @@ -316,13 +313,13 @@
1484 rb_snprintf(buffer, sizeof(buffer),
1485 "Temporary K-line %d min. - %s (%s)",
1486 (int) (tkline_time / 60), reason, current_date);
1487 - DupString(aconf->passwd, buffer);
1488 + aconf->passwd = rb_strdup(buffer);
1489 apply_tkline(source_p, aconf, reason, oper_reason, current_date, tkline_time);
1493 rb_snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
1494 - DupString(aconf->passwd, buffer);
1495 + aconf->passwd = rb_strdup(buffer);
1496 apply_kline(source_p, aconf, reason, oper_reason, current_date);
1500 apply_tkline(struct Client *source_p, struct ConfItem *aconf,
1501 const char *reason, const char *oper_reason, const char *current_date, int tkline_time)
1503 - aconf->hold = CurrentTime + tkline_time;
1504 + aconf->hold = rb_current_time() + tkline_time;
1505 add_temp_kline(aconf);
1507 /* no oper reason.. */
1508 diff -r a44630997728 modules/m_knock.c
1509 --- a/modules/m_knock.c Wed Apr 02 00:10:51 2008 +0200
1510 +++ b/modules/m_knock.c Wed Apr 02 04:03:17 2008 +0400
1514 #include "sprintf_irc.h"
1516 #include "channel.h"
1519 @@ -138,13 +137,13 @@
1520 * allow one knock per channel per knock_delay_channel
1522 if(!IsOper(source_p) &&
1523 - (source_p->localClient->last_knock + ConfigChannel.knock_delay) > CurrentTime)
1524 + (source_p->localClient->last_knock + ConfigChannel.knock_delay) > rb_current_time())
1526 sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
1527 me.name, source_p->name, name, "user");
1530 - else if((chptr->last_knock + ConfigChannel.knock_delay_channel) > CurrentTime)
1531 + else if((chptr->last_knock + ConfigChannel.knock_delay_channel) > rb_current_time())
1533 sendto_one(source_p, form_str(ERR_TOOMANYKNOCK),
1534 me.name, source_p->name, name, "channel");
1535 @@ -152,13 +151,13 @@
1538 /* ok, we actually can send the knock, tell client */
1539 - source_p->localClient->last_knock = CurrentTime;
1540 + source_p->localClient->last_knock = rb_current_time();
1542 sendto_one(source_p, form_str(RPL_KNOCKDLVR),
1543 me.name, source_p->name, name);
1546 - chptr->last_knock = CurrentTime;
1547 + chptr->last_knock = rb_current_time();
1549 if(ConfigChannel.use_knock)
1550 sendto_channel_local(chptr->mode.mode & MODE_FREEINVITE ? ALL_MEMBERS : ONLY_CHANOPS,
1551 diff -r a44630997728 modules/m_list.c
1552 --- a/modules/m_list.c Wed Apr 02 00:10:51 2008 +0200
1553 +++ b/modules/m_list.c Wed Apr 02 04:03:17 2008 +0400
1559 #include "channel.h"
1565 #include "modules.h"
1568 static rb_dlink_list safelisting_clients = { NULL, NULL, 0 };
1570 @@ -126,14 +124,14 @@
1571 if (parc < 2 || !IsChannelName(parv[1]))
1573 /* pace this due to the sheer traffic involved */
1574 - if (((last_used + ConfigFileEntry.pace_wait) > CurrentTime))
1575 + if (((last_used + ConfigFileEntry.pace_wait) > rb_current_time()))
1577 sendto_one(source_p, form_str(RPL_LOAD2HI), me.name, source_p->name, "LIST");
1578 sendto_one(source_p, form_str(RPL_LISTEND), me.name, source_p->name);
1582 - last_used = CurrentTime;
1583 + last_used = rb_current_time();
1586 return mo_list(client_p, source_p, parc, parv);
1588 s_assert(MyClient(client_p));
1589 s_assert(params != NULL);
1591 - self = MyMalloc(sizeof(struct ListClient));
1592 + self = rb_malloc(sizeof(struct ListClient));
1594 self->hash_indice = 0;
1595 self->users_min = params->users_min;
1598 rb_dlinkFindDestroy(client_p, &safelisting_clients);
1600 - MyFree(client_p->localClient->safelist_data);
1601 + rb_free(client_p->localClient->safelist_data);
1603 client_p->localClient->safelist_data = NULL;
1605 diff -r a44630997728 modules/m_lusers.c
1606 --- a/modules/m_lusers.c Wed Apr 02 00:10:51 2008 +0200
1607 +++ b/modules/m_lusers.c Wed Apr 02 04:03:17 2008 +0400
1612 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
1613 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
1615 /* safe enough to give this on a local connect only */
1616 sendto_one(source_p, form_str(RPL_LOAD2HI),
1621 - last_used = CurrentTime;
1622 + last_used = rb_current_time();
1624 if(hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2, parc, parv) !=
1626 diff -r a44630997728 modules/m_monitor.c
1627 --- a/modules/m_monitor.c Wed Apr 02 00:10:51 2008 +0200
1628 +++ b/modules/m_monitor.c Wed Apr 02 04:03:17 2008 +0400
1637 diff -r a44630997728 modules/m_motd.c
1638 --- a/modules/m_motd.c Wed Apr 02 00:10:51 2008 +0200
1639 +++ b/modules/m_motd.c Wed Apr 02 04:03:17 2008 +0400
1647 #include "numeric.h"
1650 static time_t last_used = 0;
1652 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
1653 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
1655 /* safe enough to give this on a local connect only */
1656 sendto_one(source_p, form_str(RPL_LOAD2HI),
1661 - last_used = CurrentTime;
1662 + last_used = rb_current_time();
1664 if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME)
1666 diff -r a44630997728 modules/m_names.c
1667 --- a/modules/m_names.c Wed Apr 02 00:10:51 2008 +0200
1668 +++ b/modules/m_names.c Wed Apr 02 04:03:17 2008 +0400
1672 #include "sprintf_irc.h"
1674 #include "channel.h"
1679 if(!IsOper(source_p))
1681 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
1682 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
1684 sendto_one(source_p, form_str(RPL_LOAD2HI),
1685 me.name, source_p->name, "NAMES");
1690 - last_used = CurrentTime;
1691 + last_used = rb_current_time();
1694 names_global(source_p);
1695 diff -r a44630997728 modules/m_oper.c
1696 --- a/modules/m_oper.c Wed Apr 02 00:10:51 2008 +0200
1697 +++ b/modules/m_oper.c Wed Apr 02 04:03:17 2008 +0400
1705 #include "irc_string.h"
1707 #include "numeric.h"
1708 -#include "commio.h"
1710 #include "s_newconf.h"
1712 diff -r a44630997728 modules/m_operspy.c
1713 --- a/modules/m_operspy.c Wed Apr 02 00:10:51 2008 +0200
1714 +++ b/modules/m_operspy.c Wed Apr 02 04:03:17 2008 +0400
1721 #include "channel.h"
1726 #include "numeric.h"
1727 -#include "memory.h"
1731 diff -r a44630997728 modules/m_pass.c
1732 --- a/modules/m_pass.c Wed Apr 02 00:10:51 2008 +0200
1733 +++ b/modules/m_pass.c Wed Apr 02 04:03:17 2008 +0400
1736 memset(client_p->localClient->passwd, 0,
1737 strlen(client_p->localClient->passwd));
1738 - MyFree(client_p->localClient->passwd);
1739 + rb_free(client_p->localClient->passwd);
1742 DupNString(client_p->localClient->passwd, parv[1], PASSWDLEN);
1743 diff -r a44630997728 modules/m_pong.c
1744 --- a/modules/m_pong.c Wed Apr 02 00:10:51 2008 +0200
1745 +++ b/modules/m_pong.c Wed Apr 02 04:03:17 2008 +0400
1747 sendto_realops_snomask(SNO_GENERAL, L_ALL,
1748 "End of burst (emulated) from %s (%d seconds)",
1750 - (signed int) (CurrentTime - source_p->localClient->firsttime));
1751 + (signed int) (rb_current_time() - source_p->localClient->firsttime));
1754 call_hook(h_server_eob, source_p);
1755 diff -r a44630997728 modules/m_rehash.c
1756 --- a/modules/m_rehash.c Wed Apr 02 00:10:51 2008 +0200
1757 +++ b/modules/m_rehash.c Wed Apr 02 04:03:17 2008 +0400
1760 glp_ptr = ptr->data;
1762 - MyFree(glp_ptr->reason1);
1763 - MyFree(glp_ptr->reason2);
1765 + rb_free(glp_ptr->reason1);
1766 + rb_free(glp_ptr->reason2);
1768 rb_dlinkDestroy(ptr, &pending_glines);
1771 diff -r a44630997728 modules/m_resv.c
1772 --- a/modules/m_resv.c Wed Apr 02 00:10:51 2008 +0200
1773 +++ b/modules/m_resv.c Wed Apr 02 04:03:17 2008 +0400
1774 @@ -224,13 +224,13 @@
1775 aconf = make_conf();
1776 aconf->status = CONF_RESV_CHANNEL;
1778 - DupString(aconf->name, name);
1779 - DupString(aconf->passwd, reason);
1780 + aconf->name = rb_strdup(name);
1781 + aconf->passwd = rb_strdup(reason);
1782 add_to_resv_hash(aconf->name, aconf);
1786 - aconf->hold = CurrentTime + temp_time;
1787 + aconf->hold = rb_current_time() + temp_time;
1789 sendto_realops_snomask(SNO_GENERAL, L_ALL,
1790 "%s added temporary %d min. RESV for [%s] [%s]",
1791 @@ -282,13 +282,13 @@
1792 aconf = make_conf();
1793 aconf->status = CONF_RESV_NICK;
1795 - DupString(aconf->name, name);
1796 - DupString(aconf->passwd, reason);
1797 + aconf->name = rb_strdup(name);
1798 + aconf->passwd = rb_strdup(reason);
1799 rb_dlinkAddAlloc(aconf, &resv_conf_list);
1803 - aconf->hold = CurrentTime + temp_time;
1804 + aconf->hold = rb_current_time() + temp_time;
1806 sendto_realops_snomask(SNO_GENERAL, L_ALL,
1807 "%s added temporary %d min. RESV for [%s] [%s]",
1808 diff -r a44630997728 modules/m_scan.c
1809 --- a/modules/m_scan.c Wed Apr 02 00:10:51 2008 +0200
1810 +++ b/modules/m_scan.c Wed Apr 02 04:03:17 2008 +0400
1812 #include "irc_string.h"
1814 #include "numeric.h"
1815 -#include "commio.h"
1818 #include "s_newconf.h"
1819 diff -r a44630997728 modules/m_services.c
1820 --- a/modules/m_services.c Wed Apr 02 00:10:51 2008 +0200
1821 +++ b/modules/m_services.c Wed Apr 02 04:03:17 2008 +0400
1828 #include "channel.h"
1833 #include "numeric.h"
1834 -#include "memory.h"
1836 #include "s_newconf.h"
1839 newts = atol(parv[3]);
1841 /* timestamp is older than 15mins, ignore it */
1842 - if(newts < (CurrentTime - 900))
1843 - newts = CurrentTime - 900;
1844 + if(newts < (rb_current_time() - 900))
1845 + newts = rb_current_time() - 900;
1847 target_p->tsinfo = newts;
1850 add_nd_entry(parv[2]);
1851 nd = irc_dictionary_retrieve(nd_dict, parv[2]);
1853 - nd->expire = CurrentTime + duration;
1854 + nd->expire = rb_current_time() + duration;
1858 diff -r a44630997728 modules/m_set.c
1859 --- a/modules/m_set.c Wed Apr 02 00:10:51 2008 +0200
1860 +++ b/modules/m_set.c Wed Apr 02 04:03:17 2008 +0400
1866 #include "irc_string.h"
1867 #include "sprintf_irc.h"
1869 #include "numeric.h"
1870 -#include "commio.h"
1874 diff -r a44630997728 modules/m_signon.c
1875 --- a/modules/m_signon.c Wed Apr 02 00:10:51 2008 +0200
1876 +++ b/modules/m_signon.c Wed Apr 02 04:03:17 2008 +0400
1883 #include "channel.h"
1888 #include "numeric.h"
1889 -#include "memory.h"
1895 char note[NICKLEN + 10];
1897 - send_signon(NULL, target_p, nick, user, host, CurrentTime, login);
1898 + send_signon(NULL, target_p, nick, user, host, rb_current_time(), login);
1900 rb_snprintf(note, NICKLEN + 10, "Nick: %s", target_p->name);
1901 rb_note(target_p->localClient->F, note);
1902 diff -r a44630997728 modules/m_snote.c
1903 --- a/modules/m_snote.c Wed Apr 02 00:10:51 2008 +0200
1904 +++ b/modules/m_snote.c Wed Apr 02 04:03:17 2008 +0400
1906 #include "irc_string.h"
1908 #include "numeric.h"
1909 -#include "commio.h"
1912 #include "s_newconf.h"
1913 diff -r a44630997728 modules/m_stats.c
1914 --- a/modules/m_stats.c Wed Apr 02 00:10:51 2008 +0200
1915 +++ b/modules/m_stats.c Wed Apr 02 04:03:17 2008 +0400
1920 -#include "tools.h" /* rb_dlink_node/rb_dlink_list */
1921 #include "class.h" /* report_classes */
1922 #include "client.h" /* Client */
1923 #include "common.h" /* TRUE/FALSE */
1925 #include "numeric.h" /* ERR_xxx */
1926 #include "scache.h" /* list_scache */
1927 #include "send.h" /* sendto_one */
1928 -#include "commio.h" /* highest_fd */
1929 #include "s_conf.h" /* ConfItem */
1930 #include "s_serv.h" /* hunt_server */
1931 #include "s_stats.h" /* tstats */
1932 #include "s_user.h" /* show_opers */
1933 -#include "event.h" /* events */
1934 #include "blacklist.h" /* dnsbl stuff */
1935 -#include "linebuf.h"
1937 #include "modules.h"
1940 static void stats_servlinks(struct Client *);
1941 static void stats_ltrace(struct Client *, int, const char **);
1942 static void stats_ziplinks(struct Client *);
1944 +static void stats_comm(struct Client *);
1945 /* This table contains the possible stats items, in order:
1946 * stats letter, function to call, operonly? adminonly?
1947 * case only matters in the stats letter column.. -- fl_
1949 {'D', stats_deny, 1, 0, },
1950 {'e', stats_exempt, 1, 0, },
1951 {'E', stats_events, 1, 1, },
1952 - {'f', rb_dump, 1, 1, },
1953 - {'F', rb_dump, 1, 1, },
1954 + {'f', stats_comm, 1, 1, },
1955 + {'F', stats_comm, 1, 1, },
1956 {'g', stats_pending_glines, 1, 0, },
1957 {'G', stats_glines, 1, 0, },
1958 {'h', stats_hubleaf, 0, 0, },
1960 if(MyClient(source_p) && !IsOper(source_p))
1962 /* Check the user is actually allowed to do /stats, and isnt flooding */
1963 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
1964 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
1966 /* safe enough to give this on a local connect only */
1967 sendto_one(source_p, form_str(RPL_LOAD2HI),
1972 - last_used = CurrentTime;
1973 + last_used = rb_current_time();
1976 if(hunt_server (client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME)
1977 @@ -447,10 +443,17 @@
1982 -stats_events (struct Client *source_p)
1984 - show_events (source_p);
1986 +stats_events_cb(char *str, void *ptr)
1988 + sendto_one_numeric(ptr, RPL_STATSDEBUG, "E :%s", str);
1992 +stats_events (struct Client *source_p)
1994 + rb_dump_events(stats_events_cb, source_p);
1995 + send_pop_queue(source_p);
1998 /* stats_pending_glines()
2003 - rup = (CurrentTime - startup_time) * hzz;
2004 + rup = (rb_current_time() - startup_time) * hzz;
2012 - now = CurrentTime - startup_time;
2013 + now = rb_current_time() - startup_time;
2014 sendto_one_numeric(source_p, RPL_STATSUPTIME,
2015 form_str (RPL_STATSUPTIME),
2016 now / 86400, (now / 3600) % 24,
2017 @@ -1046,7 +1049,7 @@
2018 target_p = ptr->data;
2021 - seconds = CurrentTime - target_p->localClient->firsttime;
2022 + seconds = rb_current_time() - target_p->localClient->firsttime;
2024 days = (int) (seconds / 86400);
2026 @@ -1060,8 +1063,8 @@
2027 "Connected: %d day%s, %d:%02d:%02d",
2029 (target_p->serv->by[0] ? target_p->serv->by : "Remote."),
2030 - (int) (CurrentTime - target_p->localClient->lasttime),
2031 - (int) linebuf_len (&target_p->localClient->buf_sendq),
2032 + (int) (rb_current_time() - target_p->localClient->lasttime),
2033 + (int) rb_linebuf_len (&target_p->localClient->buf_sendq),
2034 days, (days == 1) ? "" : "s", hours, minutes,
2037 @@ -1186,14 +1189,14 @@
2038 sendto_one(source_p, Sformat,
2039 get_id(&me, source_p), RPL_STATSLINKINFO, get_id(source_p, source_p),
2040 get_server_name(target_p, SHOW_IP),
2041 - (int) linebuf_len (&target_p->localClient->buf_sendq),
2042 + (int) rb_linebuf_len (&target_p->localClient->buf_sendq),
2043 (int) target_p->localClient->sendM,
2044 (int) target_p->localClient->sendK,
2045 (int) target_p->localClient->receiveM,
2046 (int) target_p->localClient->receiveK,
2047 - CurrentTime - target_p->localClient->firsttime,
2048 - (CurrentTime > target_p->localClient->lasttime) ?
2049 - (CurrentTime - target_p->localClient->lasttime) : 0,
2050 + rb_current_time() - target_p->localClient->firsttime,
2051 + (rb_current_time() > target_p->localClient->lasttime) ?
2052 + (rb_current_time() - target_p->localClient->lasttime) : 0,
2053 IsOper (source_p) ? show_capabilities (target_p) : "TS");
2056 @@ -1207,7 +1210,7 @@
2057 "? :Recv total : %7.2f %s",
2058 _GMKv (receiveK), _GMKs (receiveK));
2060 - uptime = (CurrentTime - startup_time);
2061 + uptime = (rb_current_time() - startup_time);
2063 sendto_one_numeric(source_p, RPL_STATSDEBUG,
2064 "? :Server send: %7.2f %s (%4.1f K/s)",
2065 @@ -1339,14 +1342,14 @@
2067 sendto_one_numeric(source_p, RPL_STATSLINKINFO, Lformat,
2068 get_server_name(target_p, SHOW_IP),
2069 - (int) linebuf_len(&target_p->localClient->buf_sendq),
2070 + (int) rb_linebuf_len(&target_p->localClient->buf_sendq),
2071 (int) target_p->localClient->sendM,
2072 (int) target_p->localClient->sendK,
2073 (int) target_p->localClient->receiveM,
2074 (int) target_p->localClient->receiveK,
2075 - CurrentTime - target_p->localClient->firsttime,
2076 - (CurrentTime > target_p->localClient->lasttime) ?
2077 - (CurrentTime - target_p->localClient->lasttime) : 0,
2078 + rb_current_time() - target_p->localClient->firsttime,
2079 + (rb_current_time() > target_p->localClient->lasttime) ?
2080 + (rb_current_time() - target_p->localClient->lasttime) : 0,
2081 IsOper(source_p) ? show_capabilities(target_p) : "-");
2084 @@ -1358,16 +1361,30 @@
2085 get_client_name(target_p, SHOW_IP) :
2086 get_client_name(target_p, HIDE_IP)) :
2087 get_client_name(target_p, MASK_IP),
2088 - (int) linebuf_len(&target_p->localClient->buf_sendq),
2089 + (int) rb_linebuf_len(&target_p->localClient->buf_sendq),
2090 (int) target_p->localClient->sendM,
2091 (int) target_p->localClient->sendK,
2092 (int) target_p->localClient->receiveM,
2093 (int) target_p->localClient->receiveK,
2094 - CurrentTime - target_p->localClient->firsttime,
2095 - (CurrentTime > target_p->localClient->lasttime) ?
2096 - (CurrentTime - target_p->localClient->lasttime) : 0,
2097 + rb_current_time() - target_p->localClient->firsttime,
2098 + (rb_current_time() > target_p->localClient->lasttime) ?
2099 + (rb_current_time() - target_p->localClient->lasttime) : 0,
2105 +rb_dump_fd_callback(int fd, const char *desc, void *data)
2107 + struct Client *source_p = data;
2108 + sendto_one_numeric(source_p, RPL_STATSDEBUG, "F :fd %-3d desc '%s'", fd, desc);
2112 +stats_comm(struct Client *source_p)
2114 + rb_dump_fd(rb_dump_fd_callback, source_p);
2115 + send_pop_queue(source_p);
2119 diff -r a44630997728 modules/m_svinfo.c
2120 --- a/modules/m_svinfo.c Wed Apr 02 00:10:51 2008 +0200
2121 +++ b/modules/m_svinfo.c Wed Apr 02 04:03:17 2008 +0400
2126 - * since we're here, might as well set CurrentTime while we're at it
2127 + * since we're here, might as well set rb_current_time() while we're at it
2130 theirtime = atol(parv[4]);
2131 - deltat = abs(theirtime - CurrentTime);
2132 + deltat = abs(theirtime - rb_current_time());
2134 if(deltat > ConfigFileEntry.ts_max_delta)
2137 "Link %s dropped, excessive TS delta"
2138 " (my TS=%ld, their TS=%ld, delta=%d)",
2139 get_server_name(source_p, SHOW_IP),
2140 - (long) CurrentTime, (long) theirtime, deltat);
2141 + (long) rb_current_time(), (long) theirtime, deltat);
2143 "Link %s dropped, excessive TS delta"
2144 " (my TS=%ld, their TS=%ld, delta=%d)",
2145 - log_client_name(source_p, SHOW_IP), (long) CurrentTime, (long) theirtime, deltat);
2146 + log_client_name(source_p, SHOW_IP), (long) rb_current_time(), (long) theirtime, deltat);
2147 snprintf(squitreason, sizeof squitreason, "Excessive TS delta (my TS=%ld, their TS=%ld, delta=%d)",
2148 - (long) CurrentTime, (long) theirtime, deltat);
2149 + (long) rb_current_time(), (long) theirtime, deltat);
2150 exit_client(source_p, source_p, source_p, squitreason);
2154 sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
2155 "Link %s notable TS delta"
2156 " (my TS=%ld, their TS=%ld, delta=%d)",
2157 - source_p->name, (long) CurrentTime, (long) theirtime, deltat);
2158 + source_p->name, (long) rb_current_time(), (long) theirtime, deltat);
2162 diff -r a44630997728 modules/m_tb.c
2163 --- a/modules/m_tb.c Wed Apr 02 00:10:51 2008 +0200
2164 +++ b/modules/m_tb.c Wed Apr 02 04:03:17 2008 +0400
2171 #include "channel.h"
2173 diff -r a44630997728 modules/m_testline.c
2174 --- a/modules/m_testline.c Wed Apr 02 00:10:51 2008 +0200
2175 +++ b/modules/m_testline.c Wed Apr 02 04:03:17 2008 +0400
2177 * $Id: m_testline.c 3303 2007-03-28 15:22:49Z jilles $
2183 #include "modules.h"
2185 sendto_one(source_p, form_str(RPL_TESTLINE),
2186 me.name, source_p->name,
2187 resv_p->hold ? 'q' : 'Q',
2188 - resv_p->hold ? (long) ((resv_p->hold - CurrentTime) / 60) : 0L,
2189 + resv_p->hold ? (long) ((resv_p->hold - rb_current_time()) / 60) : 0L,
2190 resv_p->name, resv_p->passwd);
2191 /* this is a false positive, so make sure it isn't counted in stats q
2194 me.name, source_p->name,
2195 (aconf->flags & CONF_FLAGS_TEMPORARY) ? 'd' : 'D',
2196 (aconf->flags & CONF_FLAGS_TEMPORARY) ?
2197 - (long) ((aconf->hold - CurrentTime) / 60) : 0L,
2198 + (long) ((aconf->hold - rb_current_time()) / 60) : 0L,
2199 aconf->host, aconf->passwd);
2203 me.name, source_p->name,
2204 (aconf->flags & CONF_FLAGS_TEMPORARY) ? 'k' : 'K',
2205 (aconf->flags & CONF_FLAGS_TEMPORARY) ?
2206 - (long) ((aconf->hold - CurrentTime) / 60) : 0L,
2207 + (long) ((aconf->hold - rb_current_time()) / 60) : 0L,
2208 buf, aconf->passwd);
2212 aconf->user, aconf->host);
2213 sendto_one(source_p, form_str(RPL_TESTLINE),
2214 me.name, source_p->name,
2215 - 'G', (long) ((aconf->hold - CurrentTime) / 60),
2216 + 'G', (long) ((aconf->hold - rb_current_time()) / 60),
2217 buf, aconf->passwd);
2221 sendto_one(source_p, form_str(RPL_TESTLINE),
2222 me.name, source_p->name,
2223 resv_p->hold ? 'q' : 'Q',
2224 - resv_p->hold ? (long) ((resv_p->hold - CurrentTime) / 60) : 0L,
2225 + resv_p->hold ? (long) ((resv_p->hold - rb_current_time()) / 60) : 0L,
2226 resv_p->name, resv_p->passwd);
2228 /* this is a false positive, so make sure it isn't counted in stats q
2230 sendto_one(source_p, form_str(RPL_TESTLINE),
2231 me.name, source_p->name,
2232 aconf->hold ? 'x' : 'X',
2233 - aconf->hold ? (long) ((aconf->hold - CurrentTime) / 60) : 0L,
2234 + aconf->hold ? (long) ((aconf->hold - rb_current_time()) / 60) : 0L,
2235 aconf->name, aconf->passwd);
2238 diff -r a44630997728 modules/m_time.c
2239 --- a/modules/m_time.c Wed Apr 02 00:10:51 2008 +0200
2240 +++ b/modules/m_time.c Wed Apr 02 04:03:17 2008 +0400
2245 - lclock = CurrentTime;
2246 + lclock = rb_current_time();
2247 gm = gmtime(&lclock);
2248 memcpy((void *) &gmbuf, (void *) gm, sizeof(gmbuf));
2250 diff -r a44630997728 modules/m_topic.c
2251 --- a/modules/m_topic.c Wed Apr 02 00:10:51 2008 +0200
2252 +++ b/modules/m_topic.c Wed Apr 02 04:03:17 2008 +0400
2258 #include "channel.h"
2262 char topic_info[USERHOST_REPLYLEN];
2263 rb_sprintf(topic_info, "%s!%s@%s",
2264 source_p->name, source_p->username, source_p->host);
2265 - set_channel_topic(chptr, parv[2], topic_info, CurrentTime);
2266 + set_channel_topic(chptr, parv[2], topic_info, rb_current_time());
2268 sendto_server(client_p, chptr, CAP_TS6, NOCAPS,
2270 diff -r a44630997728 modules/m_trace.c
2271 --- a/modules/m_trace.c Wed Apr 02 00:10:51 2008 +0200
2272 +++ b/modules/m_trace.c Wed Apr 02 04:03:17 2008 +0400
2274 #include "irc_string.h"
2276 #include "numeric.h"
2277 -#include "commio.h"
2280 #include "s_newconf.h"
2282 sendto_one_numeric(source_p, RPL_TRACEUNKNOWN,
2283 form_str(RPL_TRACEUNKNOWN),
2284 class_name, name, ip,
2285 - CurrentTime - target_p->localClient->firsttime);
2286 + rb_current_time() - target_p->localClient->firsttime);
2290 @@ -387,16 +386,16 @@
2291 form_str(RPL_TRACEOPERATOR),
2293 show_ip(source_p, target_p) ? ip : "255.255.255.255",
2294 - CurrentTime - target_p->localClient->lasttime,
2295 - CurrentTime - target_p->localClient->last);
2296 + rb_current_time() - target_p->localClient->lasttime,
2297 + rb_current_time() - target_p->localClient->last);
2300 sendto_one_numeric(source_p, RPL_TRACEUSER,
2301 form_str(RPL_TRACEUSER),
2303 show_ip(source_p, target_p) ? ip : "255.255.255.255",
2304 - CurrentTime - target_p->localClient->lasttime,
2305 - CurrentTime - target_p->localClient->last);
2306 + rb_current_time() - target_p->localClient->lasttime,
2307 + rb_current_time() - target_p->localClient->last);
2312 sendto_one_numeric(source_p, RPL_TRACESERVER, form_str(RPL_TRACESERVER),
2313 class_name, servcount, usercount, name,
2314 *(target_p->serv->by) ? target_p->serv->by : "*", "*",
2315 - me.name, CurrentTime - target_p->localClient->lasttime);
2316 + me.name, rb_current_time() - target_p->localClient->lasttime);
2320 diff -r a44630997728 modules/m_user.c
2321 --- a/modules/m_user.c Wed Apr 02 00:10:51 2008 +0200
2322 +++ b/modules/m_user.c Wed Apr 02 04:03:17 2008 +0400
2326 rb_snprintf(buf, sizeof(buf), "%s %s", parv[2], parv[3]);
2327 - MyFree(source_p->localClient->fullcaps);
2328 - DupString(source_p->localClient->fullcaps, buf);
2329 + rb_free(source_p->localClient->fullcaps);
2330 + source_p->localClient->fullcaps = rb_strdup(buf);
2332 do_local_user(client_p, source_p, parv[1], parv[4]);
2334 diff -r a44630997728 modules/m_version.c
2335 --- a/modules/m_version.c Wed Apr 02 00:10:51 2008 +0200
2336 +++ b/modules/m_version.c Wed Apr 02 04:03:17 2008 +0400
2341 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
2342 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
2344 /* safe enough to give this on a local connect only */
2345 sendto_one(source_p, form_str(RPL_LOAD2HI),
2350 - last_used = CurrentTime;
2351 + last_used = rb_current_time();
2353 if(hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME)
2355 diff -r a44630997728 modules/m_who.c
2356 --- a/modules/m_who.c Wed Apr 02 00:10:51 2008 +0200
2357 +++ b/modules/m_who.c Wed Apr 02 04:03:17 2008 +0400
2359 * $Id: m_who.c 3350 2007-04-02 22:03:08Z jilles $
2365 #include "channel.h"
2367 /* it has to be a global who at this point, limit it */
2368 if(!IsOper(source_p))
2370 - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime)
2371 + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time())
2373 sendto_one(source_p, form_str(RPL_LOAD2HI),
2374 me.name, source_p->name, "WHO");
2379 - last_used = CurrentTime;
2380 + last_used = rb_current_time();
2383 /* Note: operspy_dont_care_user_info does not apply to
2384 diff -r a44630997728 modules/m_whois.c
2385 --- a/modules/m_whois.c Wed Apr 02 00:10:51 2008 +0200
2386 +++ b/modules/m_whois.c Wed Apr 02 04:03:17 2008 +0400
2396 if(!IsOper(source_p))
2398 /* seeing as this is going across servers, we should limit it */
2399 - if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
2400 + if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time())
2402 sendto_one(source_p, form_str(RPL_LOAD2HI),
2403 me.name, source_p->name, "WHOIS");
2408 - last_used = CurrentTime;
2409 + last_used = rb_current_time();
2412 if(hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) !=
2415 sendto_one_numeric(source_p, RPL_WHOISIDLE, form_str(RPL_WHOISIDLE),
2417 - CurrentTime - target_p->localClient->last,
2418 + rb_current_time() - target_p->localClient->last,
2419 target_p->localClient->firsttime);
2422 diff -r a44630997728 modules/m_whowas.c
2423 --- a/modules/m_whowas.c Wed Apr 02 00:10:51 2008 +0200
2424 +++ b/modules/m_whowas.c Wed Apr 02 04:03:17 2008 +0400
2427 if(!IsOper(source_p))
2429 - if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime)
2430 + if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time())
2432 sendto_one(source_p, form_str(RPL_LOAD2HI),
2433 me.name, source_p->name, "WHOWAS");
2438 - last_used = CurrentTime;
2439 + last_used = rb_current_time();
2443 diff -r a44630997728 modules/m_xline.c
2444 --- a/modules/m_xline.c Wed Apr 02 00:10:51 2008 +0200
2445 +++ b/modules/m_xline.c Wed Apr 02 04:03:17 2008 +0400
2452 #include "channel.h"
2457 #include "numeric.h"
2458 -#include "memory.h"
2462 @@ -313,17 +311,17 @@
2466 - DupString(aconf->name, tmp);
2467 + aconf->name = rb_strdup(tmp);
2470 - DupString(aconf->name, name);
2471 + aconf->name = rb_strdup(name);
2473 - DupString(aconf->passwd, reason);
2474 + aconf->passwd = rb_strdup(reason);
2475 collapse(aconf->name);
2479 - aconf->hold = CurrentTime + temp_time;
2480 + aconf->hold = rb_current_time() + temp_time;
2482 sendto_realops_snomask(SNO_GENERAL, L_ALL,
2483 "%s added temporary %d min. X-Line for [%s] [%s]",
2485 get_oper_name(source_p), name, reason);
2488 - dlinkAddAlloc(aconf, &xline_conf_list);
2489 + rb_dlinkAddAlloc(aconf, &xline_conf_list);
2495 rb_sprintf(buffer, "\"%s\",\"0\",\"%s\",\"%s\",%ld\n",
2496 aconf->name, aconf->passwd,
2497 - get_oper_name(source_p), CurrentTime);
2498 + get_oper_name(source_p), rb_current_time());
2500 if(fputs(buffer, out) == -1)
2502 diff -r a44630997728 src/Makefile.in
2503 --- a/src/Makefile.in Wed Apr 02 00:10:51 2008 +0200
2504 +++ b/src/Makefile.in Wed Apr 02 04:03:17 2008 +0400
2506 SSL_LIBS = @SSL_LIBS@
2507 SSL_INCLUDES = @SSL_INCLUDES@
2509 -IRCDLIBS = @MODULES_LIBS@ -L../libcharybdis -lcharybdis -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS)
2510 +IRCDLIBS = @MODULES_LIBS@ -L../libratbox/src/.libs -lratbox @LIBS@ $(SSL_LIBS)
2512 -INCLUDES = -I../include -I../libcharybdis -I../libratbox/include $(SSL_INCLUDES)
2513 +INCLUDES = -I../include -I../libratbox/include $(SSL_INCLUDES)
2514 CPPFLAGS = ${INCLUDES} @CPPFLAGS@
2517 diff -r a44630997728 src/blacklist.c
2518 --- a/src/blacklist.c Wed Apr 02 00:10:51 2008 +0200
2519 +++ b/src/blacklist.c Wed Apr 02 04:03:17 2008 +0400
2525 -#include "memory.h"
2526 #include "numeric.h"
2531 sendto_realops_snomask(SNO_GENERAL, L_ALL,
2532 "blacklist_dns_callback(): blcptr->client_p->preClient (%s) is NULL", get_client_name(blcptr->client_p, HIDE_IP));
2539 if (reply->addr.ss_family == AF_INET &&
2540 !memcmp(&((struct sockaddr_in *)&reply->addr)->sin_addr, "\177\0\0", 3))
2542 - else if (blcptr->blacklist->lastwarning + 3600 < CurrentTime)
2543 + else if (blcptr->blacklist->lastwarning + 3600 < rb_current_time())
2545 sendto_realops_snomask(SNO_GENERAL, L_ALL,
2546 "Garbage reply from blacklist %s",
2547 blcptr->blacklist->host);
2548 - blcptr->blacklist->lastwarning = CurrentTime;
2549 + blcptr->blacklist->lastwarning = rb_current_time();
2553 @@ -112,13 +110,13 @@
2554 register_local_user(blcptr->client_p, blcptr->client_p, buf);
2561 /* XXX: no IPv6 implementation, not to concerned right now though. */
2562 static void initiate_blacklist_dnsquery(struct Blacklist *blptr, struct Client *client_p)
2564 - struct BlacklistClient *blcptr = MyMalloc(sizeof(struct BlacklistClient));
2565 + struct BlacklistClient *blcptr = rb_malloc(sizeof(struct BlacklistClient));
2566 char buf[IRCD_BUFSIZE];
2570 blptr = find_blacklist(name);
2573 - blptr = MyMalloc(sizeof(struct Blacklist));
2574 + blptr = rb_malloc(sizeof(struct Blacklist));
2575 rb_dlinkAddAlloc(blptr, &blacklist_list);
2579 if (blptr->status & CONF_ILLEGAL && blptr->refcount <= 0)
2581 rb_dlinkFindDestroy(blptr, &blacklist_list);
2588 rb_dlinkDelete(&blcptr->node, &client_p->preClient->dnsbl_queries);
2589 unref_blacklist(blcptr->blacklist);
2590 delete_resolver_queries(&blcptr->dns_query);
2597 blptr->status |= CONF_ILLEGAL;
2600 - MyFree(ptr->data);
2601 + rb_free(ptr->data);
2602 rb_dlinkDestroy(ptr, &blacklist_list);
2605 diff -r a44630997728 src/cache.c
2606 --- a/src/cache.c Wed Apr 02 00:10:51 2008 +0200
2607 +++ b/src/cache.c Wed Apr 02 04:03:17 2008 +0400
2609 #include "ircd_defs.h"
2614 -#include "memory.h"
2615 -#include "balloc.h"
2619 #include "sprintf_irc.h"
2620 diff -r a44630997728 src/channel.c
2621 --- a/src/channel.c Wed Apr 02 00:10:51 2008 +0200
2622 +++ b/src/channel.c Wed Apr 02 04:03:17 2008 +0400
2628 #include "channel.h"
2633 #include "s_conf.h" /* ConfigFileEntry, ConfigChannel */
2634 #include "s_newconf.h"
2636 -#include "memory.h"
2637 -#include "balloc.h"
2640 extern rb_dlink_list global_channel_list;
2643 struct Channel *chptr;
2644 chptr = BlockHeapAlloc(channel_heap);
2645 - DupString(chptr->chname, chname);
2646 + chptr->chname = rb_strdup(chname);
2651 free_channel(struct Channel *chptr)
2653 - MyFree(chptr->chname);
2654 + rb_free(chptr->chname);
2655 BlockHeapFree(channel_heap, chptr);
2661 bptr = BlockHeapAlloc(ban_heap);
2662 - DupString(bptr->banstr, banstr);
2663 - DupString(bptr->who, who);
2664 + bptr->banstr = rb_strdup(banstr);
2665 + bptr->who = rb_strdup(who);
2671 free_ban(struct Ban *bptr)
2673 - MyFree(bptr->banstr);
2674 - MyFree(bptr->who);
2675 + rb_free(bptr->banstr);
2676 + rb_free(bptr->who);
2677 BlockHeapFree(ban_heap, bptr);
2681 if(client_p->servptr == &me)
2682 rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
2684 - chptr->users_last = CurrentTime;
2685 + chptr->users_last = rb_current_time();
2687 if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
2688 destroy_channel(chptr);
2690 if(client_p->servptr == &me)
2691 rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers);
2693 - chptr->users_last = CurrentTime;
2694 + chptr->users_last = rb_current_time();
2696 if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0)
2697 destroy_channel(chptr);
2699 /* join throttling stuff --nenolod */
2700 else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0)
2702 - if ((CurrentTime - chptr->join_delta <=
2703 + if ((rb_current_time() - chptr->join_delta <=
2704 chptr->mode.join_time) && (chptr->join_count >=
2705 chptr->mode.join_num))
2711 - (CurrentTime - source_p->localClient->last_leave_time)) >
2712 + (rb_current_time() - source_p->localClient->last_leave_time)) >
2713 JOIN_LEAVE_COUNT_EXPIRE_TIME)
2715 decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME);
2721 + if((rb_current_time() -
2722 (source_p->localClient->last_join_time)) < GlobalSetOptions.spam_time)
2724 /* oh, its a possible spambot */
2729 - source_p->localClient->last_join_time = CurrentTime;
2730 + source_p->localClient->last_join_time = rb_current_time();
2732 - source_p->localClient->last_leave_time = CurrentTime;
2733 + source_p->localClient->last_leave_time = rb_current_time();
2737 diff -r a44630997728 src/chmode.c
2738 --- a/src/chmode.c Wed Apr 02 00:10:51 2008 +0200
2739 +++ b/src/chmode.c Wed Apr 02 04:03:17 2008 +0400
2745 #include "channel.h"
2750 #include "s_conf.h" /* ConfigFileEntry, ConfigChannel */
2751 #include "s_newconf.h"
2753 -#include "memory.h"
2754 -#include "balloc.h"
2757 /* bitmasks for error returns, so we send once per call */
2759 strlcpy(who, source_p->name, sizeof(who));
2761 actualBan = allocate_ban(realban, who);
2762 - actualBan->when = CurrentTime;
2763 + actualBan->when = rb_current_time();
2765 rb_dlinkAdd(actualBan, &actualBan->node, list);
2767 diff -r a44630997728 src/class.c
2768 --- a/src/class.c Wed Apr 02 00:10:51 2008 +0200
2769 +++ b/src/class.c Wed Apr 02 04:03:17 2008 +0400
2779 #include "s_newconf.h"
2781 #include "irc_string.h"
2782 -#include "memory.h"
2784 #define BAD_CONF_CLASS -1
2790 - tmp = (struct Class *) MyMalloc(sizeof(struct Class));
2791 + tmp = (struct Class *) rb_malloc(sizeof(struct Class));
2793 ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY;
2794 PingFreq(tmp) = DEFAULT_PINGFREQUENCY;
2797 rb_destroy_patricia(tmp->ip_limits, NULL);
2799 - MyFree(tmp->class_name);
2801 + rb_free(tmp->class_name);
2809 default_class = make_class();
2810 - DupString(ClassName(default_class), "default");
2811 + ClassName(default_class) = rb_strdup("default");
2815 diff -r a44630997728 src/client.c
2816 --- a/src/client.c Wed Apr 02 00:10:51 2008 +0200
2817 +++ b/src/client.c Wed Apr 02 04:03:17 2008 +0400
2828 #include "irc_string.h"
2829 #include "sprintf_irc.h"
2831 #include "numeric.h"
2834 -#include "commio.h"
2836 #include "s_newconf.h"
2842 -#include "linebuf.h"
2844 -#include "memory.h"
2845 #include "hostmask.h"
2846 -#include "balloc.h"
2847 #include "listener.h"
2851 SetMyConnect(client_p);
2852 client_p->localClient = localClient;
2854 - client_p->localClient->lasttime = client_p->localClient->firsttime = CurrentTime;
2855 + client_p->localClient->lasttime = client_p->localClient->firsttime = rb_current_time();
2857 client_p->localClient->F = NULL;
2858 client_p->localClient->ctrlfd = -1;
2859 @@ -229,13 +223,13 @@
2861 memset(client_p->localClient->passwd, 0,
2862 strlen(client_p->localClient->passwd));
2863 - MyFree(client_p->localClient->passwd);
2864 + rb_free(client_p->localClient->passwd);
2867 - MyFree(client_p->localClient->challenge);
2868 - MyFree(client_p->localClient->fullcaps);
2869 - MyFree(client_p->localClient->opername);
2870 - MyFree(client_p->localClient->mangledhost);
2871 + rb_free(client_p->localClient->challenge);
2872 + rb_free(client_p->localClient->fullcaps);
2873 + rb_free(client_p->localClient->opername);
2874 + rb_free(client_p->localClient->mangledhost);
2876 BlockHeapFree(lclient_heap, client_p->localClient);
2877 client_p->localClient = NULL;
2878 @@ -309,13 +303,13 @@
2880 ping = get_client_ping(client_p);
2882 - if(ping < (CurrentTime - client_p->localClient->lasttime))
2883 + if(ping < (rb_current_time() - client_p->localClient->lasttime))
2886 * If the client/server hasnt talked to us in 2*ping seconds
2887 * and it has a ping time, then close its connection.
2889 - if(((CurrentTime - client_p->localClient->lasttime) >= (2 * ping)
2890 + if(((rb_current_time() - client_p->localClient->lasttime) >= (2 * ping)
2891 && (client_p->flags & FLAGS_PINGSENT)))
2893 if(IsServer(client_p))
2896 (void) rb_snprintf(scratch, sizeof(scratch),
2897 "Ping timeout: %d seconds",
2898 - (int) (CurrentTime - client_p->localClient->lasttime));
2899 + (int) (rb_current_time() - client_p->localClient->lasttime));
2901 exit_client(client_p, client_p, &me, scratch);
2905 client_p->flags |= FLAGS_PINGSENT;
2906 /* not nice but does the job */
2907 - client_p->localClient->lasttime = CurrentTime - ping;
2908 + client_p->localClient->lasttime = rb_current_time() - ping;
2909 sendto_one(client_p, "PING :%s", me.name);
2915 timeout = IsAnyServer(client_p) ? ConfigFileEntry.connect_timeout : 30;
2916 - if((CurrentTime - client_p->localClient->firsttime) > timeout)
2917 + if((rb_current_time() - client_p->localClient->firsttime) > timeout)
2919 if(IsAnyServer(client_p))
2922 if(client_p->serv->user != NULL)
2923 free_user(client_p->serv->user, client_p);
2924 if(client_p->serv->fullcaps)
2925 - MyFree(client_p->serv->fullcaps);
2926 - MyFree(client_p->serv);
2927 + rb_free(client_p->serv->fullcaps);
2928 + rb_free(client_p->serv);
2932 @@ -1289,7 +1283,7 @@
2934 abt->client->flags &= ~FLAGS_CLOSING;
2935 exit_client(abt->client, abt->client, &me, abt->notice);
2941 @@ -1307,7 +1301,7 @@
2942 if(IsDead(client_p) || IsClosing(client_p) || IsMe(client_p))
2945 - abt = (struct abort_client *) MyMalloc(sizeof(struct abort_client));
2946 + abt = (struct abort_client *) rb_malloc(sizeof(struct abort_client));
2948 if(client_p->flags & FLAGS_SENDQEX)
2949 strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
2950 @@ -1559,10 +1553,10 @@
2952 sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s was connected"
2953 " for %ld seconds. %d/%d sendK/recvK.",
2954 - source_p->name, CurrentTime - source_p->localClient->firsttime, sendk, recvk);
2955 + source_p->name, rb_current_time() - source_p->localClient->firsttime, sendk, recvk);
2957 ilog(L_SERVER, "%s was connected for %ld seconds. %d/%d sendK/recvK.",
2958 - source_p->name, CurrentTime - source_p->localClient->firsttime, sendk, recvk);
2959 + source_p->name, rb_current_time() - source_p->localClient->firsttime, sendk, recvk);
2961 if(has_id(source_p))
2962 del_from_id_hash(source_p->id, source_p);
2963 @@ -1609,10 +1603,10 @@
2964 show_ip(NULL, source_p) ? source_p->sockhost : "255.255.255.255",
2967 - on_for = CurrentTime - source_p->localClient->firsttime;
2968 + on_for = rb_current_time() - source_p->localClient->firsttime;
2970 ilog(L_USER, "%s (%3lu:%02lu:%02lu): %s!%s@%s %d/%d",
2971 - myctime(CurrentTime), on_for / 3600,
2972 + myctime(rb_current_time()), on_for / 3600,
2973 (on_for % 3600) / 60, on_for % 60,
2974 source_p->name, source_p->username, source_p->host,
2975 source_p->localClient->sendK, source_p->localClient->receiveK);
2976 @@ -1894,7 +1888,7 @@
2980 - serv = (server_t *) MyMalloc(sizeof(server_t));
2981 + serv = (server_t *) rb_malloc(sizeof(server_t));
2982 client_p->serv = serv;
2984 return client_p->serv;
2985 @@ -1915,7 +1909,7 @@
2986 if(--user->refcnt <= 0)
2989 - MyFree((char *) user->away);
2990 + rb_free((char *) user->away);
2994 @@ -1940,6 +1934,23 @@
2996 BlockHeapFree(user_heap, user);
3001 +allocate_away(struct Client *client_p)
3003 + if(client_p->user->away == NULL)
3004 + client_p->user->away = rb_bh_alloc(away_heap);
3009 +free_away(struct Client *client_p)
3011 + if(client_p->user->away != NULL) {
3012 + rb_bh_free(away_heap, client_p->user->away);
3013 + client_p->user->away = NULL;
3018 @@ -2015,7 +2026,7 @@
3019 ServerStats->is_sbr += client_p->localClient->receiveB;
3020 ServerStats->is_sks += client_p->localClient->sendK;
3021 ServerStats->is_skr += client_p->localClient->receiveK;
3022 - ServerStats->is_sti += CurrentTime - client_p->localClient->firsttime;
3023 + ServerStats->is_sti += rb_current_time() - client_p->localClient->firsttime;
3024 if(ServerStats->is_sbs > 2047)
3026 ServerStats->is_sks += (ServerStats->is_sbs >> 10);
3027 @@ -2053,7 +2064,7 @@
3028 ServerStats->is_cbr += client_p->localClient->receiveB;
3029 ServerStats->is_cks += client_p->localClient->sendK;
3030 ServerStats->is_ckr += client_p->localClient->receiveK;
3031 - ServerStats->is_cti += CurrentTime - client_p->localClient->firsttime;
3032 + ServerStats->is_cti += rb_current_time() - client_p->localClient->firsttime;
3033 if(ServerStats->is_cbs > 2047)
3035 ServerStats->is_cks += (ServerStats->is_cbs >> 10);
3036 diff -r a44630997728 src/extban.c
3037 --- a/src/extban.c Wed Apr 02 00:10:51 2008 +0200
3038 +++ b/src/extban.c Wed Apr 02 04:03:17 2008 +0400
3044 #include "channel.h"
3047 diff -r a44630997728 src/hash.c
3048 --- a/src/hash.c Wed Apr 02 00:10:51 2008 +0200
3049 +++ b/src/hash.c Wed Apr 02 04:03:17 2008 +0400
3053 #include "ircd_defs.h"
3056 #include "channel.h"
3060 #include "numeric.h"
3062 -#include "memory.h"
3065 #include "s_newconf.h"
3070 - clientTable = MyMalloc(sizeof(rb_dlink_list) * U_MAX);
3071 - idTable = MyMalloc(sizeof(rb_dlink_list) * U_MAX);
3072 - channelTable = MyMalloc(sizeof(rb_dlink_list) * CH_MAX);
3073 - hostTable = MyMalloc(sizeof(rb_dlink_list) * HOST_MAX);
3074 - resvTable = MyMalloc(sizeof(rb_dlink_list) * R_MAX);
3075 + clientTable = rb_malloc(sizeof(rb_dlink_list) * U_MAX);
3076 + idTable = rb_malloc(sizeof(rb_dlink_list) * U_MAX);
3077 + channelTable = rb_malloc(sizeof(rb_dlink_list) * CH_MAX);
3078 + hostTable = rb_malloc(sizeof(rb_dlink_list) * HOST_MAX);
3079 + resvTable = rb_malloc(sizeof(rb_dlink_list) * R_MAX);
3082 #ifndef RICER_HASHING
3085 rb_dlinkAdd(chptr, &chptr->node, &global_channel_list);
3087 - chptr->channelts = CurrentTime; /* doesn't hurt to set it here */
3088 + chptr->channelts = rb_current_time(); /* doesn't hurt to set it here */
3090 rb_dlinkAddAlloc(chptr, &channelTable[hashv]);
3092 diff -r a44630997728 src/hook.c
3093 --- a/src/hook.c Wed Apr 02 00:10:51 2008 +0200
3094 +++ b/src/hook.c Wed Apr 02 04:03:17 2008 +0400
3096 * $Id: hook.c 712 2006-02-06 04:42:14Z gxti $
3099 -#include "memory.h"
3102 #include "irc_string.h"
3108 - hooks = MyMalloc(sizeof(hook) * HOOK_INCREMENT);
3109 + hooks = rb_malloc(sizeof(hook) * HOOK_INCREMENT);
3111 #ifdef USE_IODEBUG_HOOKS
3112 h_iosend_id = register_hook("iosend");
3117 - newhooks = MyMalloc(sizeof(hook) * (max_hooks + HOOK_INCREMENT));
3118 + newhooks = rb_malloc(sizeof(hook) * (max_hooks + HOOK_INCREMENT));
3119 memcpy(newhooks, hooks, sizeof(hook) * num_hooks);
3124 max_hooks += HOOK_INCREMENT;
3127 if((i = find_hook(name)) < 0)
3129 i = find_freehookslot();
3130 - DupString(hooks[i].name, name);
3131 + hooks[i].name = rb_strdup(name);
3135 diff -r a44630997728 src/hostmask.c
3136 --- a/src/hostmask.c Wed Apr 02 00:10:51 2008 +0200
3137 +++ b/src/hostmask.c Wed Apr 02 04:03:17 2008 +0400
3142 -#include "memory.h"
3143 #include "ircd_defs.h"
3145 #include "hostmask.h"
3149 address = "/NOMATCH!/";
3150 - arec = MyMalloc(sizeof(struct AddressRec));
3151 + arec = rb_malloc(sizeof(struct AddressRec));
3152 masktype = parse_netmask(address, (struct sockaddr *)&addr, &bits);
3154 if(masktype == HM_IPV6)
3158 address = "/NOMATCH!/";
3159 - arec = MyMalloc(sizeof(struct AddressRec));
3160 + arec = rb_malloc(sizeof(struct AddressRec));
3161 masktype = parse_netmask(address, (struct sockaddr *)&arec->Mask.ipa.addr, &bits);
3162 arec->Mask.ipa.bits = bits;
3163 arec->masktype = masktype;
3165 aconf->status |= CONF_ILLEGAL;
3174 arec->aconf->status |= CONF_ILLEGAL;
3175 if(!arec->aconf->clients)
3176 free_conf(arec->aconf);
3183 arec->aconf->status |= CONF_ILLEGAL;
3184 if(!arec->aconf->clients)
3185 free_conf(arec->aconf);
3191 diff -r a44630997728 src/irc_dictionary.c
3192 --- a/src/irc_dictionary.c Wed Apr 02 00:10:51 2008 +0200
3193 +++ b/src/irc_dictionary.c Wed Apr 02 04:03:17 2008 +0400
3197 #include "sprintf_irc.h"
3199 #include "irc_string.h"
3201 -#include "memory.h"
3203 -#include "balloc.h"
3204 #include "irc_dictionary.h"
3206 static BlockHeap *elem_heap = NULL;
3209 struct Dictionary *irc_dictionary_create(DCF compare_cb)
3211 - struct Dictionary *dtree = (struct Dictionary *) MyMalloc(sizeof(struct Dictionary));
3212 + struct Dictionary *dtree = (struct Dictionary *) rb_malloc(sizeof(struct Dictionary));
3214 dtree->compare_cb = compare_cb;
3217 struct Dictionary *irc_dictionary_create_named(const char *name,
3220 - struct Dictionary *dtree = (struct Dictionary *) MyMalloc(sizeof(struct Dictionary));
3221 + struct Dictionary *dtree = (struct Dictionary *) rb_malloc(sizeof(struct Dictionary));
3223 dtree->compare_cb = compare_cb;
3224 - DupString(dtree->id, name);
3225 + dtree->id = rb_strdup(name);
3228 elem_heap = BlockHeapCreate(sizeof(struct DictionaryElement), 1024);
3230 BlockHeapFree(elem_heap, n);
3238 diff -r a44630997728 src/irc_string.c
3239 --- a/src/irc_string.c Wed Apr 02 00:10:51 2008 +0200
3240 +++ b/src/irc_string.c Wed Apr 02 04:03:17 2008 +0400
3244 #include "sprintf_irc.h"
3246 #include "irc_string.h"
3248 -#include "memory.h"
3256 - result = MyMalloc(((length + 2) / 3) * 5);
3257 + result = rb_malloc(((length + 2) / 3) * 5);
3262 int ch, i = 0, j = 0, k;
3263 unsigned char *result;
3265 - result = MyMalloc(length + 1);
3266 + result = rb_malloc(length + 1);
3268 while ((ch = *current++) != '\0' && length-- > 0) {
3269 if (ch == base64_pad) break;
3270 diff -r a44630997728 src/ircd.c
3271 --- a/src/ircd.c Wed Apr 02 00:10:51 2008 +0200
3272 +++ b/src/ircd.c Wed Apr 02 04:03:17 2008 +0400
3279 #include "channel.h"
3285 #include "irc_string.h"
3286 #include "ircd_signal.h"
3289 #include "restart.h"
3291 -#include "commio.h"
3294 #include "s_serv.h" /* try_connections */
3296 #include "supported.h"
3298 #include "modules.h"
3299 -#include "memory.h"
3301 #include "ircd_getopt.h"
3302 -#include "balloc.h"
3303 #include "newconf.h"
3306 #include "s_newconf.h"
3308 #include "monitor.h"
3309 -#include "libcharybdis.h"
3310 #include "patchlevel.h"
3314 newtime.tv_sec = time(NULL);
3317 - if(newtime.tv_sec < CurrentTime)
3318 - rb_set_back_events(CurrentTime - newtime.tv_sec);
3319 + if(newtime.tv_sec < rb_current_time())
3320 + rb_set_back_events(rb_current_time() - newtime.tv_sec);
3322 SystemTime.tv_sec = newtime.tv_sec;
3323 SystemTime.tv_usec = newtime.tv_usec;
3327 delay = rb_event_next();
3328 - if(delay <= CurrentTime)
3329 + if(delay <= rb_current_time())
3337 - startup_time = CurrentTime;
3338 + startup_time = rb_current_time();
3339 add_to_client_hash(me.name, &me);
3340 add_to_id_hash(me.id, &me);
3341 me.serv->nameinfo = scache_connect(me.name, me.info, 0);
3342 diff -r a44630997728 src/ircd_parser.y
3343 --- a/src/ircd_parser.y Wed Apr 02 00:10:51 2008 +0200
3344 +++ b/src/ircd_parser.y Wed Apr 02 04:03:17 2008 +0400
3349 - MyFree(list->v.string);
3350 + rb_free(list->v.string);
3353 free_cur_list(list->v.list);
3356 if (cur_list == NULL)
3358 - cur_list = MyMalloc(sizeof(conf_parm_t));
3359 + cur_list = rb_malloc(sizeof(conf_parm_t));
3360 cur_list->type |= CF_FLIST;
3361 cur_list->v.list = new;
3367 - new = MyMalloc(sizeof(conf_parm_t));
3368 + new = rb_malloc(sizeof(conf_parm_t));
3376 - DupString(new->v.string, str);
3377 + new->v.string = rb_strdup(str);
3381 @@ -253,19 +253,19 @@
3385 - $$ = MyMalloc(sizeof(conf_parm_t));
3386 + $$ = rb_malloc(sizeof(conf_parm_t));
3387 $$->type = CF_QSTRING;
3388 - DupString($$->v.string, $1);
3389 + $$->v.string = rb_strdup($1);
3393 - $$ = MyMalloc(sizeof(conf_parm_t));
3394 + $$ = rb_malloc(sizeof(conf_parm_t));
3400 - $$ = MyMalloc(sizeof(conf_parm_t));
3401 + $$ = rb_malloc(sizeof(conf_parm_t));
3406 so pass it as that, if so */
3407 int val = conf_get_yesno_value($1);
3409 - $$ = MyMalloc(sizeof(conf_parm_t));
3410 + $$ = rb_malloc(sizeof(conf_parm_t));
3417 $$->type = CF_STRING;
3418 - DupString($$->v.string, $1);
3419 + $$->v.string = rb_strdup($1);
3423 diff -r a44630997728 src/ircd_signal.c
3424 --- a/src/ircd_signal.c Wed Apr 02 00:10:51 2008 +0200
3425 +++ b/src/ircd_signal.c Wed Apr 02 04:03:17 2008 +0400
3427 #include "ircd.h" /* dorehash */
3428 #include "restart.h" /* server_reboot */
3430 -#include "memory.h"
3431 -#include "commio.h"
3435 diff -r a44630997728 src/ircd_state.c
3436 --- a/src/ircd_state.c Wed Apr 02 00:10:51 2008 +0200
3437 +++ b/src/ircd_state.c Wed Apr 02 04:03:17 2008 +0400
3445 #include "channel.h"
3451 #include "irc_string.h"
3452 #include "ircd_signal.h"
3455 #include "restart.h"
3457 -#include "commio.h"
3460 #include "s_serv.h" /* try_connections */
3464 #include "modules.h"
3465 -#include "memory.h"
3467 #include "ircd_getopt.h"
3468 -#include "balloc.h"
3469 #include "newconf.h"
3470 #include "patricia.h"
3473 #include "s_newconf.h"
3475 #include "monitor.h"
3476 -#include "libcharybdis.h"
3477 #include "patchlevel.h"
3480 diff -r a44630997728 src/kdparse.c
3481 --- a/src/kdparse.c Wed Apr 02 00:10:51 2008 +0200
3482 +++ b/src/kdparse.c Wed Apr 02 04:03:17 2008 +0400
3490 #include "s_newconf.h"
3491 #include "hostmask.h"
3493 #include "irc_string.h"
3494 -#include "memory.h"
3497 /* conf_add_fields()
3499 const char *operreason_field, const char *date_field)
3501 if(host_field != NULL)
3502 - DupString(aconf->host, host_field);
3503 + aconf->host = rb_strdup(host_field);
3504 if(pass_field != NULL)
3506 if(!EmptyString(date_field))
3508 - aconf->passwd = MyMalloc(strlen(pass_field) + strlen(date_field) + 4);
3509 + aconf->passwd = rb_malloc(strlen(pass_field) + strlen(date_field) + 4);
3510 rb_sprintf(aconf->passwd, "%s (%s)", pass_field, date_field);
3513 - DupString(aconf->passwd, pass_field);
3514 + aconf->passwd = rb_strdup(pass_field);
3516 if(user_field != NULL)
3517 - DupString(aconf->user, user_field);
3518 + aconf->user = rb_strdup(user_field);
3519 if(operreason_field != NULL)
3520 - DupString(aconf->spasswd, operreason_field);
3521 + aconf->spasswd = rb_strdup(operreason_field);
3526 aconf = make_conf();
3527 aconf->status = CONF_XLINE;
3529 - DupString(aconf->name, gecos_field);
3530 - DupString(aconf->passwd, reason_field);
3531 + aconf->name = rb_strdup(gecos_field);
3532 + aconf->passwd = rb_strdup(reason_field);
3534 rb_dlinkAddAlloc(aconf, &xline_conf_list);
3537 aconf->status = CONF_RESV_CHANNEL;
3540 - DupString(aconf->name, host_field);
3541 - DupString(aconf->passwd, reason_field);
3542 + aconf->name = rb_strdup(host_field);
3543 + aconf->passwd = rb_strdup(reason_field);
3544 add_to_resv_hash(aconf->name, aconf);
3546 else if(clean_resv_nick(host_field))
3548 aconf->status = CONF_RESV_NICK;
3551 - DupString(aconf->name, host_field);
3552 - DupString(aconf->passwd, reason_field);
3553 + aconf->name = rb_strdup(host_field);
3554 + aconf->passwd = rb_strdup(reason_field);
3555 rb_dlinkAddAlloc(aconf, &resv_conf_list);
3558 diff -r a44630997728 src/listener.c
3559 --- a/src/listener.c Wed Apr 02 00:10:51 2008 +0200
3560 +++ b/src/listener.c Wed Apr 02 04:03:17 2008 +0400
3563 #include "ircd_defs.h"
3564 #include "numeric.h"
3565 -#include "commio.h"
3567 #include "s_newconf.h"
3568 #include "s_stats.h"
3570 -#include "memory.h"
3576 make_listener(struct irc_sockaddr_storage *addr)
3578 - listener_t *listener = (listener_t *) MyMalloc(sizeof(listener_t));
3579 + listener_t *listener = (listener_t *) rb_malloc(sizeof(listener_t));
3580 s_assert(0 != listener);
3582 listener->name = me.name;
3588 + rb_free(listener);
3591 #define PORTNAMELEN 6 /* ":31337" */
3592 @@ -530,12 +528,12 @@
3594 * slow down the whining to opers bit
3596 - if((last_oper_notice + 20) <= CurrentTime)
3597 + if((last_oper_notice + 20) <= rb_current_time())
3599 sendto_realops_snomask(SNO_GENERAL, L_ALL,
3600 "All connections in use. (%s)",
3601 get_listener_name(listener));
3602 - last_oper_notice = CurrentTime;
3603 + last_oper_notice = rb_current_time();
3606 write(fd, "ERROR :All connections in use\r\n", 32);
3607 diff -r a44630997728 src/modules.c
3608 --- a/src/modules.c Wed Apr 02 00:10:51 2008 +0200
3609 +++ b/src/modules.c Wed Apr 02 04:03:17 2008 +0400
3612 #include "ircd_defs.h"
3613 #include "irc_string.h"
3614 -#include "memory.h"
3616 #include "sprintf_irc.h"
3620 if(mod_find_path(path))
3623 - pathst = MyMalloc(sizeof(struct module_path));
3624 + pathst = rb_malloc(sizeof(struct module_path));
3626 strcpy(pathst->path, path);
3627 rb_dlinkAddAlloc(pathst, &mod_paths);
3630 RB_DLINK_FOREACH_SAFE(ptr, next_ptr, mod_paths.head)
3632 - MyFree(ptr->data);
3633 + rb_free(ptr->data);
3634 free_rb_dlink_node(ptr);
3639 irc_basename(const char *path)
3641 - char *mod_basename = MyMalloc(strlen(path) + 1);
3642 + char *mod_basename = rb_malloc(strlen(path) + 1);
3645 if(!(s = strrchr(path, '/')))
3650 - modlist = (struct module **) MyMalloc(sizeof(struct module) * (MODS_INCREMENT));
3651 + modlist = (struct module **) rb_malloc(sizeof(struct module) * (MODS_INCREMENT));
3653 max_mods = MODS_INCREMENT;
3655 @@ -366,13 +364,13 @@
3656 if(findmodule_byname(m_bn) != -1)
3658 sendto_one_notice(source_p, ":Module %s is already loaded", m_bn);
3664 load_one_module(parv[1], 0);
3671 @@ -397,14 +395,14 @@
3672 if((modindex = findmodule_byname(m_bn)) == -1)
3674 sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
3680 if(modlist[modindex]->core == 1)
3682 sendto_one_notice(source_p, ":Module %s is a core module and may not be unloaded", m_bn);
3689 sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
3698 if((modindex = findmodule_byname(m_bn)) == -1)
3700 sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
3707 if(unload_one_module(m_bn, 1) == -1)
3709 sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
3726 dlclose(modlist[modindex]->address);
3728 - MyFree(modlist[modindex]->name);
3729 + rb_free(modlist[modindex]->name);
3730 memcpy(&modlist[modindex], &modlist[modindex + 1],
3731 sizeof(struct module) * ((num_mods - 1) - modindex));
3734 sendto_realops_snomask(SNO_GENERAL, L_ALL,
3735 "Error loading module %s: %s", mod_basename, err);
3736 ilog(L_MAIN, "Error loading module %s: %s", mod_basename, err);
3737 - MyFree(mod_basename);
3738 + rb_free(mod_basename);
3744 ilog(L_MAIN, "Data format error: module %s has no MAPI header.", mod_basename);
3745 (void) dlclose(tmpptr);
3746 - MyFree(mod_basename);
3747 + rb_free(mod_basename);
3752 "Module %s indicated failure during load.",
3755 - MyFree(mod_basename);
3756 + rb_free(mod_basename);
3759 if(mheader->mapi_command_list)
3761 "Module %s has unknown/unsupported MAPI version %d.",
3762 mod_basename, *mapi_version);
3764 - MyFree(mod_basename);
3765 + rb_free(mod_basename);
3769 @@ -890,11 +888,11 @@
3773 - modlist[num_mods] = MyMalloc(sizeof(struct module));
3774 + modlist[num_mods] = rb_malloc(sizeof(struct module));
3775 modlist[num_mods]->address = tmpptr;
3776 modlist[num_mods]->version = ver;
3777 modlist[num_mods]->core = core;
3778 - DupString(modlist[num_mods]->name, mod_basename);
3779 + modlist[num_mods]->name = rb_strdup(mod_basename);
3780 modlist[num_mods]->mapi_header = mapi_version;
3781 modlist[num_mods]->mapi_version = MAPI_VERSION(*mapi_version);
3784 ilog(L_MAIN, "Module %s [version: %s; MAPI version: %d] loaded at 0x%lx",
3785 mod_basename, ver, MAPI_VERSION(*mapi_version), (unsigned long) tmpptr);
3787 - MyFree(mod_basename);
3788 + rb_free(mod_basename);
3792 @@ -927,11 +925,11 @@
3793 if((num_mods + 1) < max_mods)
3796 - new_modlist = (struct module **) MyMalloc(sizeof(struct module) *
3797 + new_modlist = (struct module **) rb_malloc(sizeof(struct module) *
3798 (max_mods + MODS_INCREMENT));
3799 memcpy((void *) new_modlist, (void *) modlist, sizeof(struct module) * num_mods);
3803 modlist = new_modlist;
3804 max_mods += MODS_INCREMENT;
3806 diff -r a44630997728 src/monitor.c
3807 --- a/src/monitor.c Wed Apr 02 00:10:51 2008 +0200
3808 +++ b/src/monitor.c Wed Apr 02 04:03:17 2008 +0400
3810 * $Id: monitor.c 3520 2007-06-30 22:15:35Z jilles $
3815 -#include "memory.h"
3816 -#include "balloc.h"
3817 #include "monitor.h"
3820 #include "numeric.h"
3822 -static struct monitor *monitorTable[MONITOR_HASH_SIZE];
3823 -BlockHeap *monitor_heap;
3825 -static void cleanup_monitor(void *unused);
3826 +struct monitor *monitorTable[MONITOR_HASH_SIZE];
3827 +static rb_bh *monitor_heap;
3832 - monitor_heap = BlockHeapCreate(sizeof(struct monitor), MONITOR_HEAP_SIZE);
3833 - eventAddIsh("cleanup_monitor", cleanup_monitor, NULL, 3600);
3834 + monitor_heap = rb_bh_create(sizeof(struct monitor), MONITOR_HEAP_SIZE, "monitor_heap");
3837 static inline unsigned int
3838 hash_monitor_nick(const char *name)
3840 - return fnv_hash_upper((const unsigned char *) name, MONITOR_HASH_BITS);
3841 + return fnv_hash_upper((const unsigned char *)name, MONITOR_HASH_BITS, 0);
3845 find_monitor(const char *name, int add)
3847 - struct monitor *monptr;
3848 + struct monitor *monptr;
3850 + unsigned int hashv = hash_monitor_nick(name);
3852 + for(monptr = monitorTable[hashv]; monptr; monptr = monptr->hnext)
3854 + if(!irccmp(monptr->name, name))
3860 + monptr = rb_bh_alloc(monitor_heap);
3861 + rb_strlcpy(monptr->name, name, sizeof(monptr->name));
3863 + monptr->hnext = monitorTable[hashv];
3864 + monitorTable[hashv] = monptr;
3872 - unsigned int hashv = hash_monitor_nick(name);
3874 - for(monptr = monitorTable[hashv]; monptr; monptr = monptr->hnext)
3876 - if(!irccmp(monptr->name, name))
3882 - monptr = BlockHeapAlloc(monitor_heap);
3883 - strlcpy(monptr->name, name, sizeof(monptr->name));
3885 - monptr->hnext = monitorTable[hashv];
3886 - monitorTable[hashv] = monptr;
3893 +free_monitor(struct monitor *monptr)
3895 + rb_bh_free(monitor_heap, monptr);
3901 monitor_signon(struct Client *client_p)
3903 - char buf[USERHOST_REPLYLEN];
3904 - struct monitor *monptr = find_monitor(client_p->name, 0);
3906 - /* noones watching this nick */
3907 - if(monptr == NULL)
3910 - rb_snprintf(buf, sizeof(buf), "%s!%s@%s",
3911 - client_p->name, client_p->username, client_p->host);
3913 + char buf[USERHOST_REPLYLEN];
3914 + struct monitor *monptr = find_monitor(client_p->name, 0);
3916 + /* noones watching this nick */
3917 + if(monptr == NULL)
3920 + rb_snprintf(buf, sizeof(buf), "%s!%s@%s", client_p->name, client_p->username, client_p->host);
3922 sendto_monitor(monptr, form_str(RPL_MONONLINE), me.name, "*", buf);
3925 @@ -119,62 +117,30 @@
3927 monitor_signoff(struct Client *client_p)
3929 - struct monitor *monptr = find_monitor(client_p->name, 0);
3931 - /* noones watching this nick */
3932 - if(monptr == NULL)
3935 - sendto_monitor(monptr, form_str(RPL_MONOFFLINE), me.name, "*",
3936 + struct monitor *monptr = find_monitor(client_p->name, 0);
3938 + /* noones watching this nick */
3939 + if(monptr == NULL)
3942 + sendto_monitor(monptr, form_str(RPL_MONOFFLINE), me.name, "*",
3947 clear_monitor(struct Client *client_p)
3949 - struct monitor *monptr;
3950 - rb_dlink_node *ptr, *next_ptr;
3952 - RB_DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->monitor_list.head)
3954 - monptr = ptr->data;
3956 - /* we leave the actual entry around with no users, itll be
3957 - * cleaned up periodically by cleanup_monitor() --anfl
3959 - rb_dlinkFindDestroy(client_p, &monptr->users);
3960 - free_rb_dlink_node(ptr);
3963 - client_p->localClient->monitor_list.head = client_p->localClient->monitor_list.tail = NULL;
3964 + struct monitor *monptr;
3965 + rb_dlink_node *ptr, *next_ptr;
3967 + RB_DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->monitor_list.head)
3969 + monptr = ptr->data;
3971 + rb_dlinkFindDestroy(client_p, &monptr->users);
3972 + rb_free_rb_dlink_node(ptr);
3975 + client_p->localClient->monitor_list.head = client_p->localClient->monitor_list.tail = NULL;
3976 client_p->localClient->monitor_list.length = 0;
3980 -cleanup_monitor(void *unused)
3982 - struct monitor *last_ptr = NULL;
3983 - struct monitor *next_ptr, *ptr;
3986 - for(i = 0; i < MONITOR_HASH_SIZE; i++)
3989 - for(ptr = monitorTable[i]; ptr; ptr = next_ptr)
3991 - next_ptr = ptr->hnext;
3993 - if(!rb_dlink_list_length(&ptr->users))
3996 - last_ptr->hnext = next_ptr;
3998 - monitorTable[i] = next_ptr;
4000 - BlockHeapFree(monitor_heap, ptr);
4007 diff -r a44630997728 src/newconf.c
4008 --- a/src/newconf.c Wed Apr 02 00:10:51 2008 +0200
4009 +++ b/src/newconf.c Wed Apr 02 04:03:17 2008 +0400
4011 #include <openssl/rsa.h>
4014 -#include "memory.h"
4015 #include "newconf.h"
4017 #include "ircd_defs.h"
4018 #include "sprintf_irc.h"
4021 #include "listener.h"
4022 #include "hostmask.h"
4032 - tc = MyMalloc(sizeof(struct TopConf));
4033 + tc = rb_malloc(sizeof(struct TopConf));
4036 tc->tc_sfunc = sfunc;
4040 rb_dlinkDestroy(ptr, &conf_items);
4048 /* the ircd will exit() in main() if we dont set one */
4049 if(strlen(s) <= HOSTLEN)
4050 - DupString(ServerInfo.name, (char *) data);
4051 + ServerInfo.name = rb_strdup((char *) data);
4056 if((p = strchr((char *) data, ' ')))
4059 - MyFree(ServerInfo.network_name);
4060 - DupString(ServerInfo.network_name, (char *) data);
4061 + rb_free(ServerInfo.network_name);
4062 + ServerInfo.network_name = rb_strdup((char *) data);
4068 load_one_module((char *) data, 0);
4073 conf_report_error("Ignoring modules::module -- loadable module support not present.");
4076 if(strlen(conf_cur_block_name) > OPERNICKLEN)
4077 conf_cur_block_name[OPERNICKLEN] = '\0';
4079 - DupString(yy_oper->name, conf_cur_block_name);
4080 + yy_oper->name = rb_strdup(conf_cur_block_name);
4083 if(EmptyString(yy_oper->name))
4084 @@ -512,11 +509,11 @@
4086 yy_tmpoper = ptr->data;
4088 - DupString(yy_tmpoper->name, yy_oper->name);
4089 + yy_tmpoper->name = rb_strdup(yy_oper->name);
4091 /* could be an rsa key instead.. */
4092 if(!EmptyString(yy_oper->passwd))
4093 - DupString(yy_tmpoper->passwd, yy_oper->passwd);
4094 + yy_tmpoper->passwd = rb_strdup(yy_oper->passwd);
4096 yy_tmpoper->flags = yy_oper->flags;
4097 yy_tmpoper->umodes = yy_oper->umodes;
4098 @@ -582,14 +579,14 @@
4102 - DupString(yy_tmpoper->username, host);
4103 - DupString(yy_tmpoper->host, p);
4104 + yy_tmpoper->username = rb_strdup(host);
4105 + yy_tmpoper->host = rb_strdup(p);
4110 - DupString(yy_tmpoper->username, "*");
4111 - DupString(yy_tmpoper->host, host);
4112 + yy_tmpoper->username = rb_strdup("*");
4113 + yy_tmpoper->host = rb_strdup(host);
4116 if(EmptyString(yy_tmpoper->username) || EmptyString(yy_tmpoper->host))
4117 @@ -608,18 +605,18 @@
4120 memset(yy_oper->passwd, 0, strlen(yy_oper->passwd));
4121 - MyFree(yy_oper->passwd);
4122 + rb_free(yy_oper->passwd);
4125 - DupString(yy_oper->passwd, (char *) data);
4126 + yy_oper->passwd = rb_strdup((char *) data);
4130 conf_set_oper_rsa_public_key_file(void *data)
4132 #ifdef HAVE_LIBCRYPTO
4133 - MyFree(yy_oper->rsa_pubkey_file);
4134 - DupString(yy_oper->rsa_pubkey_file, (char *) data);
4135 + rb_free(yy_oper->rsa_pubkey_file);
4136 + yy_oper->rsa_pubkey_file = rb_strdup((char *) data);
4138 conf_report_error("Warning -- ignoring rsa_public_key_file (OpenSSL support not available");
4141 conf_end_class(struct TopConf *tc)
4143 if(conf_cur_block_name != NULL)
4144 - DupString(yy_class->class_name, conf_cur_block_name);
4145 + yy_class->class_name = rb_strdup(conf_cur_block_name);
4147 if(EmptyString(yy_class->class_name))
4151 conf_begin_listen(struct TopConf *tc)
4153 - MyFree(listener_address);
4154 + rb_free(listener_address);
4155 listener_address = NULL;
4160 conf_end_listen(struct TopConf *tc)
4162 - MyFree(listener_address);
4163 + rb_free(listener_address);
4164 listener_address = NULL;
4169 conf_set_listen_address(void *data)
4171 - MyFree(listener_address);
4172 - DupString(listener_address, data);
4173 + rb_free(listener_address);
4174 + listener_address = rb_strdup(data);
4179 rb_dlink_node *next_ptr;
4181 if(EmptyString(yy_aconf->name))
4182 - DupString(yy_aconf->name, "NOMATCH");
4183 + yy_aconf->name = rb_strdup("NOMATCH");
4185 /* didnt even get one ->host? */
4186 if(EmptyString(yy_aconf->host))
4187 @@ -839,13 +836,13 @@
4190 if(yy_aconf->passwd)
4191 - DupString(yy_tmp->passwd, yy_aconf->passwd);
4192 + yy_tmp->passwd = rb_strdup(yy_aconf->passwd);
4194 /* this will always exist.. */
4195 - DupString(yy_tmp->name, yy_aconf->name);
4196 + yy_tmp->name = rb_strdup(yy_aconf->name);
4198 if(yy_aconf->className)
4199 - DupString(yy_tmp->className, yy_aconf->className);
4200 + yy_tmp->className = rb_strdup(yy_aconf->className);
4202 yy_tmp->flags = yy_aconf->flags;
4203 yy_tmp->port = yy_aconf->port;
4204 @@ -882,13 +879,13 @@
4208 - DupString(yy_tmp->user, data);
4209 - DupString(yy_tmp->host, p);
4210 + yy_tmp->user = rb_strdup(data);
4211 + yy_tmp->host = rb_strdup(p);
4215 - DupString(yy_tmp->user, "*");
4216 - DupString(yy_tmp->host, data);
4217 + yy_tmp->user = rb_strdup("*");
4218 + yy_tmp->host = rb_strdup(data);
4221 if(yy_aconf != yy_tmp)
4224 if(yy_aconf->passwd)
4225 memset(yy_aconf->passwd, 0, strlen(yy_aconf->passwd));
4226 - MyFree(yy_aconf->passwd);
4227 - DupString(yy_aconf->passwd, data);
4228 + rb_free(yy_aconf->passwd);
4229 + yy_aconf->passwd = rb_strdup(data);
4237 - MyFree(yy_aconf->name);
4238 - DupString(yy_aconf->name, data);
4239 + rb_free(yy_aconf->name);
4240 + yy_aconf->name = rb_strdup(data);
4241 yy_aconf->flags |= CONF_FLAGS_SPOOF_IP;
4245 conf_set_auth_redir_serv(void *data)
4247 yy_aconf->flags |= CONF_FLAGS_REDIR;
4248 - MyFree(yy_aconf->name);
4249 - DupString(yy_aconf->name, data);
4250 + rb_free(yy_aconf->name);
4251 + yy_aconf->name = rb_strdup(data);
4257 conf_set_auth_class(void *data)
4259 - MyFree(yy_aconf->className);
4260 - DupString(yy_aconf->className, data);
4261 + rb_free(yy_aconf->className);
4262 + yy_aconf->className = rb_strdup(data);
4265 /* ok, shared_oper handles the stacking, shared_flags handles adding
4266 @@ -1041,11 +1038,11 @@
4270 - DupString(yy_shared->server, args->v.string);
4271 + yy_shared->server = rb_strdup(args->v.string);
4275 - DupString(yy_shared->server, "*");
4276 + yy_shared->server = rb_strdup("*");
4278 if((args->type & CF_MTYPE) != CF_QSTRING)
4280 @@ -1063,14 +1060,14 @@
4284 - DupString(yy_shared->host, "*");
4285 + yy_shared->host = rb_strdup("*");
4287 - DupString(yy_shared->host, p);
4288 + yy_shared->host = rb_strdup(p);
4290 if(EmptyString(username))
4291 - DupString(yy_shared->username, "*");
4292 + yy_shared->username = rb_strdup("*");
4294 - DupString(yy_shared->username, username);
4295 + yy_shared->username = rb_strdup(username);
4297 rb_dlinkAddAlloc(yy_shared, &yy_shared_list);
4299 @@ -1111,7 +1108,7 @@
4300 yy_server->flags |= SERVER_TB;
4302 if(conf_cur_block_name != NULL)
4303 - DupString(yy_server->name, conf_cur_block_name);
4304 + yy_server->name = rb_strdup(conf_cur_block_name);
4308 @@ -1164,8 +1161,8 @@
4310 conf_set_connect_host(void *data)
4312 - MyFree(yy_server->host);
4313 - DupString(yy_server->host, data);
4314 + rb_free(yy_server->host);
4315 + yy_server->host = rb_strdup(data);
4316 if (strchr(yy_server->host, ':'))
4317 yy_server->aftype = AF_INET6;
4319 @@ -1189,10 +1186,10 @@
4320 if(yy_server->spasswd)
4322 memset(yy_server->spasswd, 0, strlen(yy_server->spasswd));
4323 - MyFree(yy_server->spasswd);
4324 + rb_free(yy_server->spasswd);
4327 - DupString(yy_server->spasswd, data);
4328 + yy_server->spasswd = rb_strdup(data);
4332 @@ -1201,9 +1198,9 @@
4333 if(yy_server->passwd)
4335 memset(yy_server->passwd, 0, strlen(yy_server->passwd));
4336 - MyFree(yy_server->passwd);
4337 + rb_free(yy_server->passwd);
4339 - DupString(yy_server->passwd, data);
4340 + yy_server->passwd = rb_strdup(data);
4344 @@ -1254,8 +1251,8 @@
4345 yy_hub = make_remote_conf();
4346 yy_hub->flags = CONF_HUB;
4348 - DupString(yy_hub->host, data);
4349 - DupString(yy_hub->server, yy_server->name);
4350 + yy_hub->host = rb_strdup(data);
4351 + yy_hub->server = rb_strdup(yy_server->name);
4352 rb_dlinkAdd(yy_hub, &yy_hub->node, &hubleaf_conf_list);
4355 @@ -1270,16 +1267,16 @@
4356 yy_leaf = make_remote_conf();
4357 yy_leaf->flags = CONF_LEAF;
4359 - DupString(yy_leaf->host, data);
4360 - DupString(yy_leaf->server, yy_server->name);
4361 + yy_leaf->host = rb_strdup(data);
4362 + yy_leaf->server = rb_strdup(yy_server->name);
4363 rb_dlinkAdd(yy_leaf, &yy_leaf->node, &hubleaf_conf_list);
4367 conf_set_connect_class(void *data)
4369 - MyFree(yy_server->class_name);
4370 - DupString(yy_server->class_name, data);
4371 + rb_free(yy_server->class_name);
4372 + yy_server->class_name = rb_strdup(data);
4376 @@ -1294,8 +1291,8 @@
4379 yy_tmp = make_conf();
4380 - DupString(yy_tmp->passwd, "*");
4381 - DupString(yy_tmp->host, data);
4382 + yy_tmp->passwd = rb_strdup("*");
4383 + yy_tmp->host = rb_strdup(data);
4384 yy_tmp->status = CONF_EXEMPTDLINE;
4385 add_conf_by_address(yy_tmp->host, CONF_EXEMPTDLINE, NULL, yy_tmp);
4387 @@ -1327,7 +1324,7 @@
4388 free_remote_conf(yy_shared);
4390 yy_shared = make_remote_conf();
4391 - DupString(yy_shared->server, data);
4392 + yy_shared->server = rb_strdup(data);
4393 rb_dlinkAddAlloc(yy_shared, &yy_cluster_list);
4396 @@ -1575,7 +1572,7 @@
4400 - DupString(tmp, data);
4401 + tmp = rb_strdup(data);
4402 rb_dlinkAddAlloc(tmp, &service_list);
4404 if((target_p = find_server(NULL, tmp)))
4405 @@ -1585,10 +1582,10 @@
4407 conf_begin_alias(struct TopConf *tc)
4409 - yy_alias = MyMalloc(sizeof(struct alias_entry));
4410 + yy_alias = rb_malloc(sizeof(struct alias_entry));
4412 if (conf_cur_block_name != NULL)
4413 - DupString(yy_alias->name, conf_cur_block_name);
4414 + yy_alias->name = rb_strdup(conf_cur_block_name);
4416 yy_alias->flags = 0;
4418 @@ -1606,7 +1603,7 @@
4420 conf_report_error("Ignoring alias -- must have a name.");
4423 + rb_free(yy_alias);
4427 @@ -1615,7 +1612,7 @@
4429 conf_report_error("Ignoring alias -- must have a target.");
4432 + rb_free(yy_alias);
4436 @@ -1634,7 +1631,7 @@
4437 if (data == NULL || yy_alias == NULL) /* this shouldn't ever happen */
4440 - DupString(yy_alias->name, data);
4441 + yy_alias->name = rb_strdup(data);
4445 @@ -1643,25 +1640,25 @@
4446 if (data == NULL || yy_alias == NULL) /* this shouldn't ever happen */
4449 - DupString(yy_alias->target, data);
4450 + yy_alias->target = rb_strdup(data);
4454 conf_set_blacklist_host(void *data)
4456 - DupString(yy_blacklist_host, data);
4457 + yy_blacklist_host = rb_strdup(data);
4461 conf_set_blacklist_reason(void *data)
4463 - DupString(yy_blacklist_reason, data);
4464 + yy_blacklist_reason = rb_strdup(data);
4466 if (yy_blacklist_host && yy_blacklist_reason)
4468 new_blacklist(yy_blacklist_host, yy_blacklist_reason);
4469 - MyFree(yy_blacklist_host);
4470 - MyFree(yy_blacklist_reason);
4471 + rb_free(yy_blacklist_host);
4472 + rb_free(yy_blacklist_reason);
4473 yy_blacklist_host = NULL;
4474 yy_blacklist_reason = NULL;
4476 @@ -1700,7 +1697,7 @@
4480 - DupString(conf_cur_block_name, name);
4481 + conf_cur_block_name = rb_strdup(name);
4483 conf_cur_block_name = NULL;
4485 @@ -1717,7 +1714,7 @@
4487 return tc->tc_efunc(tc);
4489 - MyFree(conf_cur_block_name);
4490 + rb_free(conf_cur_block_name);
4494 @@ -1736,8 +1733,8 @@
4495 if(len && strlen(input) > len)
4499 - DupString(*loc, input);
4501 + *loc = rb_strdup(input);
4505 @@ -1779,9 +1776,9 @@
4506 value->v.list->type = CF_STRING;
4508 if(cp->v.number == 1)
4509 - DupString(cp->v.string, "yes");
4510 + cp->v.string = rb_strdup("yes");
4512 - DupString(cp->v.string, "no");
4513 + cp->v.string = rb_strdup("no");
4516 /* maybe it's a CF_TIME and they passed CF_INT --
4517 @@ -1849,7 +1846,7 @@
4518 if((cf = find_conf_item(tc, name)) != NULL)
4521 - cf = MyMalloc(sizeof(struct ConfEntry));
4522 + cf = rb_malloc(sizeof(struct ConfEntry));
4526 @@ -1878,7 +1875,7 @@
4529 rb_dlinkDestroy(ptr, &tc->tc_items);
4535 diff -r a44630997728 src/numeric.c
4536 --- a/src/numeric.c Wed Apr 02 00:10:51 2008 +0200
4537 +++ b/src/numeric.c Wed Apr 02 04:03:17 2008 +0400
4539 #include "numeric.h"
4540 #include "irc_string.h"
4541 #include "common.h" /* NULL cripes */
4542 -#include "memory.h"
4544 #include "messages.tab"
4546 diff -r a44630997728 src/packet.c
4547 --- a/src/packet.c Wed Apr 02 00:10:51 2008 +0200
4548 +++ b/src/packet.c Wed Apr 02 04:03:17 2008 +0400
4550 * $Id: packet.c 3446 2007-05-14 22:21:16Z jilles $
4554 -#include "commio.h"
4561 #include "irc_string.h"
4562 -#include "memory.h"
4567 reply->datalen |= *len;
4568 reply->gotdatalen++;
4569 if(reply->datalen > 0)
4570 - reply->data = MyMalloc(reply->datalen);
4571 + reply->data = rb_malloc(reply->datalen);
4574 if(reply->gotdatalen < 2)
4577 /* reset SlinkRpl */
4578 if(reply->datalen > 0)
4579 - MyFree(reply->data);
4580 + rb_free(reply->data);
4583 if(IsAnyDead(server))
4585 call_hook(h_iorecv_id, &hdata);
4588 - if(client_p->localClient->lasttime < CurrentTime)
4589 - client_p->localClient->lasttime = CurrentTime;
4590 + if(client_p->localClient->lasttime < rb_current_time())
4591 + client_p->localClient->lasttime = rb_current_time();
4592 client_p->flags &= ~FLAGS_PINGSENT;
4595 diff -r a44630997728 src/parse.c
4596 --- a/src/parse.c Wed Apr 02 00:10:51 2008 +0200
4597 +++ b/src/parse.c Wed Apr 02 04:03:17 2008 +0400
4602 -#include "memory.h"
4606 diff -r a44630997728 src/reject.c
4607 --- a/src/reject.c Wed Apr 02 00:10:51 2008 +0200
4608 +++ b/src/reject.c Wed Apr 02 04:03:17 2008 +0400
4610 #include "patricia.h"
4616 #include "s_stats.h"
4618 @@ -100,11 +98,11 @@
4620 rdata = pnode->data;
4622 - if(rdata->time + ConfigFileEntry.reject_duration > CurrentTime)
4623 + if(rdata->time + ConfigFileEntry.reject_duration > rb_current_time())
4626 rb_dlinkDelete(ptr, &reject_list);
4629 patricia_remove(reject_tree, pnode);
4633 if((pnode = match_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip)) != NULL)
4635 rdata = pnode->data;
4636 - rdata->time = CurrentTime;
4637 + rdata->time = rb_current_time();
4644 pnode = make_and_lookup_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip, bitlen);
4645 - pnode->data = rdata = MyMalloc(sizeof(struct reject_data));
4646 + pnode->data = rdata = rb_malloc(sizeof(struct reject_data));
4647 rb_dlinkAddTail(pnode, &rdata->rnode, &reject_list);
4648 - rdata->time = CurrentTime;
4649 + rdata->time = rb_current_time();
4652 rdata->mask_hashv = hashv;
4655 rdata = pnode->data;
4657 - rdata->time = CurrentTime;
4658 + rdata->time = rb_current_time();
4659 if(rdata->count > ConfigFileEntry.reject_after_count)
4661 ServerStats->is_rej++;
4664 rdata = pnode->data;
4665 rb_dlinkDelete(ptr, &reject_list);
4668 patricia_remove(reject_tree, pnode);
4673 struct reject_data *rdata = pnode->data;
4674 rb_dlinkDelete(&rdata->rnode, &reject_list);
4677 patricia_remove(reject_tree, pnode);
4681 if (rdata->mask_hashv == hashv)
4683 rb_dlinkDelete(ptr, &reject_list);
4686 patricia_remove(reject_tree, pnode);
4689 diff -r a44630997728 src/res.c
4690 --- a/src/res.c Wed Apr 02 00:10:51 2008 +0200
4691 +++ b/src/res.c Wed Apr 02 04:03:18 2008 +0400
4693 #include "ircd_defs.h"
4696 -#include "commio.h"
4701 #include "irc_string.h"
4702 #include "sprintf_irc.h"
4703 #include "numeric.h"
4706 static void timeout_resolver(void *notused)
4708 - timeout_query_list(CurrentTime);
4709 + timeout_query_list(rb_current_time());
4714 void init_resolver(void)
4717 - srand48(CurrentTime);
4718 + srand48(rb_current_time());
4723 static void rem_request(struct reslist *request)
4725 rb_dlinkDelete(&request->node, &request_list);
4726 - MyFree(request->name);
4728 + rb_free(request->name);
4735 static struct reslist *make_request(struct DNSQuery *query)
4737 - struct reslist *request = MyMalloc(sizeof(struct reslist));
4738 + struct reslist *request = rb_malloc(sizeof(struct reslist));
4740 - request->sentat = CurrentTime;
4741 + request->sentat = rb_current_time();
4742 request->retries = 3;
4743 request->resend = 1;
4744 request->timeout = 4; /* start at 4 and exponential inc. */
4746 if (request == NULL)
4748 request = make_request(query);
4749 - request->name = (char *)MyMalloc(strlen(host_name) + 1);
4750 + request->name = (char *)rb_malloc(strlen(host_name) + 1);
4751 strcpy(request->name, host_name);
4752 request->state = REQ_A;
4756 request = make_request(query);
4757 memcpy(&request->addr, addr, sizeof(struct irc_sockaddr_storage));
4758 - request->name = (char *)MyMalloc(HOSTLEN + 1);
4759 + request->name = (char *)rb_malloc(HOSTLEN + 1);
4762 if (addr->ss_family == AF_INET)
4765 reply = make_dnsreply(request);
4766 (*request->query->callback) (request->query->ptr, reply);
4769 rem_request(request);
4773 struct DNSReply *cp;
4774 s_assert(request != 0);
4776 - cp = (struct DNSReply *)MyMalloc(sizeof(struct DNSReply));
4777 + cp = (struct DNSReply *)rb_malloc(sizeof(struct DNSReply));
4779 cp->h_name = request->name;
4780 memcpy(&cp->addr, &request->addr, sizeof(cp->addr));
4781 diff -r a44630997728 src/reslib.c
4782 --- a/src/reslib.c Wed Apr 02 00:10:51 2008 +0200
4783 +++ b/src/reslib.c Wed Apr 02 04:03:18 2008 +0400
4785 #include "ircd_defs.h"
4788 -#include "commio.h"
4793 #include "irc_string.h"
4794 #include "sprintf_irc.h"
4796 diff -r a44630997728 src/restart.c
4797 --- a/src/restart.c Wed Apr 02 00:10:51 2008 +0200
4798 +++ b/src/restart.c Wed Apr 02 04:03:18 2008 +0400
4804 #include "restart.h"
4809 #include "client.h" /* for FLAGS_ALL */
4810 -#include "memory.h"
4813 extern char **myargv;
4814 diff -r a44630997728 src/s_auth.c
4815 --- a/src/s_auth.c Wed Apr 02 00:10:51 2008 +0200
4816 +++ b/src/s_auth.c Wed Apr 02 04:03:18 2008 +0400
4827 #include "irc_string.h"
4828 #include "sprintf_irc.h"
4830 #include "numeric.h"
4833 -#include "commio.h"
4835 #include "s_stats.h"
4837 -#include "memory.h"
4839 #include "blacklist.h"
4842 client->localClient->auth_request = request;
4844 request->client = client;
4845 - request->timeout = CurrentTime + ConfigFileEntry.connect_timeout;
4846 + request->timeout = rb_current_time() + ConfigFileEntry.connect_timeout;
4854 - if(auth->timeout < CurrentTime)
4855 + if(auth->timeout < rb_current_time())
4860 sendheader(auth->client, REPORT_FAIL_DNS);
4863 - auth->client->localClient->lasttime = CurrentTime;
4864 + auth->client->localClient->lasttime = rb_current_time();
4865 release_auth_client(auth);
4868 diff -r a44630997728 src/s_conf.c
4869 --- a/src/s_conf.c Wed Apr 02 00:10:51 2008 +0200
4870 +++ b/src/s_conf.c Wed Apr 02 04:03:18 2008 +0400
4874 #include "ircd_defs.h"
4877 #include "s_newconf.h"
4885 #include "irc_string.h"
4886 #include "sprintf_irc.h"
4888 #include "hostmask.h"
4889 #include "modules.h"
4890 #include "numeric.h"
4891 -#include "commio.h"
4894 #include "s_gline.h"
4895 -#include "memory.h"
4896 -#include "balloc.h"
4897 #include "patricia.h"
4900 @@ -144,12 +139,12 @@
4902 memset(aconf->spasswd, 0, strlen(aconf->spasswd));
4904 - MyFree(aconf->passwd);
4905 - MyFree(aconf->spasswd);
4906 - MyFree(aconf->name);
4907 - MyFree(aconf->className);
4908 - MyFree(aconf->user);
4909 - MyFree(aconf->host);
4910 + rb_free(aconf->passwd);
4911 + rb_free(aconf->spasswd);
4912 + rb_free(aconf->name);
4913 + rb_free(aconf->className);
4914 + rb_free(aconf->user);
4915 + rb_free(aconf->host);
4917 BlockHeapFree(confitem_heap, aconf);
4920 /* ServerInfo.name is not rehashable */
4921 /* ServerInfo.name = ServerInfo.name; */
4922 ServerInfo.description = NULL;
4923 - DupString(ServerInfo.network_name, NETWORK_NAME_DEFAULT);
4924 - DupString(ServerInfo.network_desc, NETWORK_DESC_DEFAULT);
4925 + ServerInfo.network_name = rb_strdup(NETWORK_NAME_DEFAULT);
4926 + ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT);
4928 memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
4929 ServerInfo.specific_ipv4_vhost = 0;
4931 AdminInfo.email = NULL;
4932 AdminInfo.description = NULL;
4934 - DupString(ConfigFileEntry.default_operstring, "is an IRC operator");
4935 - DupString(ConfigFileEntry.default_adminstring, "is a Server Administrator");
4936 - DupString(ConfigFileEntry.servicestring, "is a Network Service");
4937 + ConfigFileEntry.default_operstring = rb_strdup("is an IRC operator");
4938 + ConfigFileEntry.default_adminstring = rb_strdup("is a Server Administrator");
4939 + ConfigFileEntry.servicestring = rb_strdup("is a Network Service");
4941 ConfigFileEntry.default_umodes = UMODE_INVISIBLE;
4942 ConfigFileEntry.failed_oper_notice = YES;
4944 ConfigFileEntry.hide_error_messages = 1;
4945 ConfigFileEntry.dots_in_ident = 0;
4946 ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT;
4947 - DupString(ConfigFileEntry.servlink_path, SLPATH);
4948 + ConfigFileEntry.servlink_path = rb_strdup(SLPATH);
4949 ConfigFileEntry.egdpool_path = NULL;
4950 ConfigFileEntry.use_whois_actually = YES;
4951 ConfigFileEntry.burst_away = NO;
4952 @@ -880,13 +875,13 @@
4953 ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;
4955 if(ConfigFileEntry.servlink_path == NULL)
4956 - DupString(ConfigFileEntry.servlink_path, SLPATH);
4957 + ConfigFileEntry.servlink_path = rb_strdup(SLPATH);
4959 if(ServerInfo.network_name == NULL)
4960 - DupString(ServerInfo.network_name, NETWORK_NAME_DEFAULT);
4961 + ServerInfo.network_name = rb_strdup(NETWORK_NAME_DEFAULT);
4963 if(ServerInfo.network_desc == NULL)
4964 - DupString(ServerInfo.network_desc, NETWORK_DESC_DEFAULT);
4965 + ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT);
4967 if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) ||
4968 (ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX))
4969 @@ -940,17 +935,17 @@
4971 add_temp_kline(struct ConfItem *aconf)
4973 - if(aconf->hold >= CurrentTime + (10080 * 60))
4974 + if(aconf->hold >= rb_current_time() + (10080 * 60))
4976 rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_WEEK]);
4977 aconf->port = TEMP_WEEK;
4979 - else if(aconf->hold >= CurrentTime + (1440 * 60))
4980 + else if(aconf->hold >= rb_current_time() + (1440 * 60))
4982 rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_DAY]);
4983 aconf->port = TEMP_DAY;
4985 - else if(aconf->hold >= CurrentTime + (60 * 60))
4986 + else if(aconf->hold >= rb_current_time() + (60 * 60))
4988 rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_HOUR]);
4989 aconf->port = TEMP_HOUR;
4990 @@ -974,17 +969,17 @@
4992 add_temp_dline(struct ConfItem *aconf)
4994 - if(aconf->hold >= CurrentTime + (10080 * 60))
4995 + if(aconf->hold >= rb_current_time() + (10080 * 60))
4997 rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_WEEK]);
4998 aconf->port = TEMP_WEEK;
5000 - else if(aconf->hold >= CurrentTime + (1440 * 60))
5001 + else if(aconf->hold >= rb_current_time() + (1440 * 60))
5003 rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_DAY]);
5004 aconf->port = TEMP_DAY;
5006 - else if(aconf->hold >= CurrentTime + (60 * 60))
5007 + else if(aconf->hold >= rb_current_time() + (60 * 60))
5009 rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_HOUR]);
5010 aconf->port = TEMP_HOUR;
5011 @@ -1017,7 +1012,7 @@
5015 - if(aconf->hold <= CurrentTime)
5016 + if(aconf->hold <= rb_current_time())
5018 /* Alert opers that a TKline expired - Hwy */
5019 if(ConfigFileEntry.tkline_expire_notices)
5020 @@ -1042,7 +1037,7 @@
5024 - if(aconf->hold < (CurrentTime + (60 * 60)))
5025 + if(aconf->hold < (rb_current_time() + (60 * 60)))
5027 rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
5028 &temp_klines[TEMP_MIN] : &temp_dlines[TEMP_MIN]);
5029 @@ -1050,14 +1045,14 @@
5031 else if(aconf->port > TEMP_HOUR)
5033 - if(aconf->hold < (CurrentTime + (1440 * 60)))
5034 + if(aconf->hold < (rb_current_time() + (1440 * 60)))
5036 rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
5037 &temp_klines[TEMP_HOUR] : &temp_dlines[TEMP_HOUR]);
5038 aconf->port = TEMP_HOUR;
5040 else if(aconf->port > TEMP_DAY &&
5041 - (aconf->hold < (CurrentTime + (10080 * 60))))
5042 + (aconf->hold < (rb_current_time() + (10080 * 60))))
5044 rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ?
5045 &temp_klines[TEMP_DAY] : &temp_dlines[TEMP_DAY]);
5046 @@ -1198,9 +1193,9 @@
5048 struct alias_entry *aptr = ptr->data;
5050 - MyFree(aptr->name);
5051 - MyFree(aptr->target);
5053 + rb_free(aptr->name);
5054 + rb_free(aptr->target);
5059 @@ -1238,19 +1233,19 @@
5062 /* clean out ServerInfo */
5063 - MyFree(ServerInfo.description);
5064 + rb_free(ServerInfo.description);
5065 ServerInfo.description = NULL;
5066 - MyFree(ServerInfo.network_name);
5067 + rb_free(ServerInfo.network_name);
5068 ServerInfo.network_name = NULL;
5069 - MyFree(ServerInfo.network_desc);
5070 + rb_free(ServerInfo.network_desc);
5071 ServerInfo.network_desc = NULL;
5073 /* clean out AdminInfo */
5074 - MyFree(AdminInfo.name);
5075 + rb_free(AdminInfo.name);
5076 AdminInfo.name = NULL;
5077 - MyFree(AdminInfo.email);
5078 + rb_free(AdminInfo.email);
5079 AdminInfo.email = NULL;
5080 - MyFree(AdminInfo.description);
5081 + rb_free(AdminInfo.description);
5082 AdminInfo.description = NULL;
5084 /* operator{} and class{} blocks are freed above */
5085 @@ -1262,12 +1257,12 @@
5088 /* clean out general */
5089 - MyFree(ConfigFileEntry.servlink_path);
5090 + rb_free(ConfigFileEntry.servlink_path);
5091 ConfigFileEntry.servlink_path = NULL;
5093 RB_DLINK_FOREACH_SAFE(ptr, next_ptr, service_list.head)
5095 - MyFree(ptr->data);
5096 + rb_free(ptr->data);
5097 rb_dlinkDestroy(ptr, &service_list);
5100 @@ -1382,18 +1377,18 @@
5101 rb_snprintf(buffer, sizeof(buffer),
5102 "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
5103 user, host, reason, oper_reason, current_date,
5104 - get_oper_name(source_p), CurrentTime);
5105 + get_oper_name(source_p), rb_current_time());
5107 else if(type == DLINE_TYPE)
5109 rb_snprintf(buffer, sizeof(buffer),
5110 "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n", host,
5111 - reason, oper_reason, current_date, get_oper_name(source_p), CurrentTime);
5112 + reason, oper_reason, current_date, get_oper_name(source_p), rb_current_time());
5114 else if(type == RESV_TYPE)
5116 rb_snprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
5117 - host, reason, get_oper_name(source_p), CurrentTime);
5118 + host, reason, get_oper_name(source_p), rb_current_time());
5121 if(fputs(buffer, out) == -1)
5122 @@ -1449,7 +1444,7 @@
5124 if(aconf->className == NULL)
5126 - DupString(aconf->className, "default");
5127 + aconf->className = rb_strdup("default");
5128 ClassPtr(aconf) = default_class;
5131 @@ -1465,16 +1460,16 @@
5132 aconf->className, aconf->user, aconf->host);
5135 - MyFree(aconf->className);
5136 - DupString(aconf->className, "default");
5137 + rb_free(aconf->className);
5138 + aconf->className = rb_strdup("default");
5142 if(ConfMaxUsers(aconf) < 0)
5144 ClassPtr(aconf) = default_class;
5145 - MyFree(aconf->className);
5146 - DupString(aconf->className, "default");
5147 + rb_free(aconf->className);
5148 + aconf->className = rb_strdup("default");
5152 diff -r a44630997728 src/s_gline.c
5153 --- a/src/s_gline.c Wed Apr 02 00:10:51 2008 +0200
5154 +++ b/src/s_gline.c Wed Apr 02 04:03:18 2008 +0400
5160 #include "channel.h"
5165 #include "hostmask.h"
5166 #include "numeric.h"
5167 -#include "commio.h"
5173 #include "s_gline.h"
5176 -#include "memory.h"
5178 rb_dlink_list glines;
5181 kill_ptr = gline_node->data;
5183 /* these are in chronological order */
5184 - if(kill_ptr->hold > CurrentTime)
5185 + if(kill_ptr->hold > rb_current_time())
5188 rb_dlinkDestroy(gline_node, &glines);
5189 @@ -155,12 +151,12 @@
5190 glp_ptr = pending_node->data;
5192 if(((glp_ptr->last_gline_time + GLINE_PENDING_EXPIRE) <=
5193 - CurrentTime) || find_is_glined(glp_ptr->host, glp_ptr->user))
5194 + rb_current_time()) || find_is_glined(glp_ptr->host, glp_ptr->user))
5197 - MyFree(glp_ptr->reason1);
5198 - MyFree(glp_ptr->reason2);
5200 + rb_free(glp_ptr->reason1);
5201 + rb_free(glp_ptr->reason2);
5203 rb_dlinkDestroy(pending_node, &pending_glines);
5206 diff -r a44630997728 src/s_log.c
5207 --- a/src/s_log.c Wed Apr 02 00:10:51 2008 +0200
5208 +++ b/src/s_log.c Wed Apr 02 04:03:18 2008 +0400
5211 static char buf[MAX_DATE_STRING];
5213 - time_t ltime = CurrentTime;
5214 + time_t ltime = rb_current_time();
5216 lt = localtime(<ime);
5218 diff -r a44630997728 src/s_newconf.c
5219 --- a/src/s_newconf.c Wed Apr 02 00:10:51 2008 +0200
5220 +++ b/src/s_newconf.c Wed Apr 02 04:03:18 2008 +0400
5224 #include "s_newconf.h"
5227 -#include "memory.h"
5230 #include "hostmask.h"
5231 #include "newconf.h"
5233 -#include "balloc.h"
5235 #include "sprintf_irc.h"
5236 #include "irc_dictionary.h"
5239 struct remote_conf *
5240 make_remote_conf(void)
5242 - struct remote_conf *remote_p = MyMalloc(sizeof(struct remote_conf));
5243 + struct remote_conf *remote_p = rb_malloc(sizeof(struct remote_conf));
5247 @@ -168,10 +164,10 @@
5248 if(remote_p == NULL)
5251 - MyFree(remote_p->username);
5252 - MyFree(remote_p->host);
5253 - MyFree(remote_p->server);
5255 + rb_free(remote_p->username);
5256 + rb_free(remote_p->host);
5257 + rb_free(remote_p->server);
5258 + rb_free(remote_p);
5264 make_oper_conf(void)
5266 - struct oper_conf *oper_p = MyMalloc(sizeof(struct oper_conf));
5267 + struct oper_conf *oper_p = rb_malloc(sizeof(struct oper_conf));
5271 @@ -261,24 +257,24 @@
5275 - MyFree(oper_p->username);
5276 - MyFree(oper_p->host);
5277 - MyFree(oper_p->name);
5278 + rb_free(oper_p->username);
5279 + rb_free(oper_p->host);
5280 + rb_free(oper_p->name);
5284 memset(oper_p->passwd, 0, strlen(oper_p->passwd));
5285 - MyFree(oper_p->passwd);
5286 + rb_free(oper_p->passwd);
5289 #ifdef HAVE_LIBCRYPTO
5290 - MyFree(oper_p->rsa_pubkey_file);
5291 + rb_free(oper_p->rsa_pubkey_file);
5293 if(oper_p->rsa_pubkey)
5294 RSA_free(oper_p->rsa_pubkey);
5303 struct server_conf *
5304 make_server_conf(void)
5306 - struct server_conf *server_p = MyMalloc(sizeof(struct server_conf));
5307 + struct server_conf *server_p = rb_malloc(sizeof(struct server_conf));
5308 server_p->aftype = AF_INET;
5311 @@ -388,19 +384,19 @@
5312 if(!EmptyString(server_p->passwd))
5314 memset(server_p->passwd, 0, strlen(server_p->passwd));
5315 - MyFree(server_p->passwd);
5316 + rb_free(server_p->passwd);
5319 if(!EmptyString(server_p->spasswd))
5321 memset(server_p->spasswd, 0, strlen(server_p->spasswd));
5322 - MyFree(server_p->spasswd);
5323 + rb_free(server_p->spasswd);
5326 - MyFree(server_p->name);
5327 - MyFree(server_p->host);
5328 - MyFree(server_p->class_name);
5330 + rb_free(server_p->name);
5331 + rb_free(server_p->host);
5332 + rb_free(server_p->class_name);
5333 + rb_free(server_p);
5339 if(EmptyString(server_p->class_name))
5341 - DupString(server_p->class_name, "default");
5342 + server_p->class_name = rb_strdup("default");
5343 server_p->class = default_class;
5347 conf_report_error("Warning connect::class invalid for %s",
5350 - MyFree(server_p->class_name);
5351 - DupString(server_p->class_name, "default");
5352 + rb_free(server_p->class_name);
5353 + server_p->class_name = rb_strdup("default");
5356 if(strchr(server_p->host, '*') || strchr(server_p->host, '?'))
5361 - if(aconf->hold && aconf->hold <= CurrentTime)
5362 + if(aconf->hold && aconf->hold <= rb_current_time())
5364 if(ConfigFileEntry.tkline_expire_notices)
5365 sendto_realops_snomask(SNO_GENERAL, L_ALL,
5370 - if(aconf->hold && aconf->hold <= CurrentTime)
5371 + if(aconf->hold && aconf->hold <= rb_current_time())
5373 if(ConfigFileEntry.tkline_expire_notices)
5374 sendto_realops_snomask(SNO_GENERAL, L_ALL,
5379 - if(aconf->hold && aconf->hold <= CurrentTime)
5380 + if(aconf->hold && aconf->hold <= rb_current_time())
5382 if(ConfigFileEntry.tkline_expire_notices)
5383 sendto_realops_snomask(SNO_GENERAL, L_ALL,
5385 nd = BlockHeapAlloc(nd_heap);
5387 strlcpy(nd->name, name, sizeof(nd->name));
5388 - nd->expire = CurrentTime + ConfigFileEntry.nick_delay;
5389 + nd->expire = rb_current_time() + ConfigFileEntry.nick_delay;
5391 /* this list is ordered */
5392 rb_dlinkAddTail(nd, &nd->lnode, &nd_list);
5394 /* this list is ordered - we can stop when we hit the first
5395 * entry that doesnt expire..
5397 - if(nd->expire > CurrentTime)
5398 + if(nd->expire > rb_current_time())
5402 @@ -805,14 +801,14 @@
5403 if(find_tgchange(host))
5406 - target = MyMalloc(sizeof(tgchange));
5407 + target = rb_malloc(sizeof(tgchange));
5408 pnode = make_and_lookup(tgchange_tree, host);
5410 pnode->data = target;
5411 target->pnode = pnode;
5413 - DupString(target->ip, host);
5414 - target->expiry = CurrentTime + (60*60*12);
5415 + target->ip = rb_strdup(host);
5416 + target->expiry = rb_current_time() + (60*60*12);
5418 rb_dlinkAdd(target, &target->node, &tgchange_list);
5420 diff -r a44630997728 src/s_serv.c
5421 --- a/src/s_serv.c Wed Apr 02 00:10:51 2008 +0200
5422 +++ b/src/s_serv.c Wed Apr 02 04:03:18 2008 +0400
5424 #include <openssl/rsa.h>
5434 #include "irc_string.h"
5435 #include "sprintf_irc.h"
5437 #include "numeric.h"
5440 -#include "commio.h"
5442 #include "s_newconf.h"
5448 -#include "memory.h"
5449 #include "channel.h" /* chcap_usage_counts stuff... */
5453 /* only bother if we haven't already got something queued... */
5454 if(!target_p->localClient->slinkq)
5456 - target_p->localClient->slinkq = MyMalloc(1); /* sigh.. */
5457 + target_p->localClient->slinkq = rb_malloc(1); /* sigh.. */
5458 target_p->localClient->slinkq[0] = SLINKCMD_ZIPSTATS;
5459 target_p->localClient->slinkq_ofs = 0;
5460 target_p->localClient->slinkq_len = 1;
5462 * made one successfull connection... [this algorithm is
5463 * a bit fuzzy... -- msa >;) ]
5465 - if(tmp_p->hold > CurrentTime)
5466 + if(tmp_p->hold > rb_current_time())
5468 if(next > tmp_p->hold || next == 0)
5473 confrq = get_con_freq(cltmp);
5474 - tmp_p->hold = CurrentTime + confrq;
5475 + tmp_p->hold = rb_current_time() + confrq;
5478 * Found a CONNECT config with port specified, scan clients
5479 @@ -1020,7 +1016,7 @@
5480 if(client_p->localClient->passwd)
5482 memset(client_p->localClient->passwd, 0, strlen(client_p->localClient->passwd));
5483 - MyFree(client_p->localClient->passwd);
5484 + rb_free(client_p->localClient->passwd);
5485 client_p->localClient->passwd = NULL;
5488 @@ -1083,7 +1079,7 @@
5489 SetServlink(client_p);
5492 - sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, CurrentTime);
5493 + sendto_one(client_p, "SVINFO %d %d 0 :%ld", TS_CURRENT, TS_MIN, rb_current_time());
5495 client_p->servptr = &me;
5497 @@ -1111,13 +1107,13 @@
5499 if(client_p->localClient->fullcaps)
5501 - DupString(client_p->serv->fullcaps, client_p->localClient->fullcaps);
5502 - MyFree(client_p->localClient->fullcaps);
5503 + client_p->serv->fullcaps = rb_strdup(client_p->localClient->fullcaps);
5504 + rb_free(client_p->localClient->fullcaps);
5505 client_p->localClient->fullcaps = NULL;
5508 client_p->serv->nameinfo = scache_connect(client_p->name, client_p->info, IsHidden(client_p));
5509 - client_p->localClient->firsttime = CurrentTime;
5510 + client_p->localClient->firsttime = rb_current_time();
5511 /* fixing eob timings.. -gnp */
5513 if((rb_dlink_list_length(&lclient_list) + rb_dlink_list_length(&serv_list)) >
5514 @@ -1251,7 +1247,7 @@
5518 - iobuf = MyMalloc(256); /* XXX: This seems arbitrary. Perhaps make it IRCD_BUFSIZE? --nenolod */
5519 + iobuf = rb_malloc(256); /* XXX: This seems arbitrary. Perhaps make it IRCD_BUFSIZE? --nenolod */
5521 if(IsCapable(server, CAP_ZIP))
5523 diff -r a44630997728 src/s_stats.c
5524 --- a/src/s_stats.c Wed Apr 02 00:10:51 2008 +0200
5525 +++ b/src/s_stats.c Wed Apr 02 04:03:18 2008 +0400
5527 #include "irc_string.h"
5529 #include "numeric.h"
5530 -#include "commio.h"
5532 -#include "memory.h"
5534 #include "s_newconf.h"
5537 sp->is_sbr += target_p->localClient->receiveB;
5538 sp->is_sks += target_p->localClient->sendK;
5539 sp->is_skr += target_p->localClient->receiveK;
5540 - sp->is_sti += CurrentTime - target_p->localClient->firsttime;
5541 + sp->is_sti += rb_current_time() - target_p->localClient->firsttime;
5543 if(sp->is_sbs > 1023)
5546 sp->is_cbr += target_p->localClient->receiveB;
5547 sp->is_cks += target_p->localClient->sendK;
5548 sp->is_ckr += target_p->localClient->receiveK;
5549 - sp->is_cti += CurrentTime - target_p->localClient->firsttime;
5550 + sp->is_cti += rb_current_time() - target_p->localClient->firsttime;
5552 if(sp->is_cbs > 1023)
5554 diff -r a44630997728 src/s_user.c
5555 --- a/src/s_user.c Wed Apr 02 00:10:51 2008 +0200
5556 +++ b/src/s_user.c Wed Apr 02 04:03:18 2008 +0400
5563 #include "channel.h"
5566 #include "listener.h"
5568 #include "numeric.h"
5569 -#include "commio.h"
5571 #include "s_newconf.h"
5575 #include "supported.h"
5577 -#include "memory.h"
5582 if(rb_dlink_list_length(&source_p->preClient->dnsbl_queries) > 0)
5585 - client_p->localClient->last = CurrentTime;
5586 + client_p->localClient->last = rb_current_time();
5587 /* Straight up the maximum rate of flooding... */
5588 source_p->localClient->allow_read = MAX_FLOOD_BURST;
5591 if(source_p->localClient->passwd)
5593 memset(source_p->localClient->passwd, 0, strlen(source_p->localClient->passwd));
5594 - MyFree(source_p->localClient->passwd);
5595 + rb_free(source_p->localClient->passwd);
5596 source_p->localClient->passwd = NULL;
5600 source_p->localClient->passwd);
5602 memset(source_p->localClient->passwd, 0, strlen(source_p->localClient->passwd));
5603 - MyFree(source_p->localClient->passwd);
5604 + rb_free(source_p->localClient->passwd);
5605 source_p->localClient->passwd = NULL;
5610 source_p->flags2 &= ~OPER_FLAGS;
5612 - MyFree(source_p->localClient->opername);
5613 + rb_free(source_p->localClient->opername);
5614 source_p->localClient->opername = NULL;
5616 rb_dlinkFindDestroy(source_p, &local_oper_list);
5617 @@ -1277,7 +1274,7 @@
5618 SetExemptKline(source_p);
5620 source_p->flags2 |= oper_p->flags;
5621 - DupString(source_p->localClient->opername, oper_p->name);
5622 + source_p->localClient->opername = rb_strdup(oper_p->name);
5624 rb_dlinkAddAlloc(source_p, &local_oper_list);
5625 rb_dlinkAddAlloc(source_p, &oper_list);
5626 diff -r a44630997728 src/scache.c
5627 --- a/src/scache.c Wed Apr 02 00:10:51 2008 +0200
5628 +++ b/src/scache.c Wed Apr 02 04:03:18 2008 +0400
5630 #include "numeric.h"
5633 -#include "memory.h"
5637 @@ -100,13 +99,13 @@
5641 - ptr = (struct scache_entry *) MyMalloc(sizeof(struct scache_entry));
5642 + ptr = (struct scache_entry *) rb_malloc(sizeof(struct scache_entry));
5645 strlcpy(ptr->name, name, sizeof(ptr->name));
5646 ptr->info[0] = '\0';
5648 - ptr->known_since = CurrentTime;
5649 + ptr->known_since = rb_current_time();
5650 ptr->last_connect = 0;
5651 ptr->last_split = 0;
5654 ptr->flags |= SC_HIDDEN;
5656 ptr->flags &= ~SC_HIDDEN;
5657 - ptr->last_connect = CurrentTime;
5658 + ptr->last_connect = rb_current_time();
5665 ptr->flags &= ~SC_ONLINE;
5666 - ptr->last_split = CurrentTime;
5667 + ptr->last_split = rb_current_time();
5670 const char *scache_get_name(struct scache_entry *ptr)
5672 !ConfigServerHide.disable_hidden)
5674 else if (scache_ptr->flags & SC_ONLINE)
5675 - show = scache_ptr->known_since < CurrentTime - ConfigServerHide.links_delay;
5676 + show = scache_ptr->known_since < rb_current_time() - ConfigServerHide.links_delay;
5678 - show = scache_ptr->last_split > CurrentTime - ConfigServerHide.links_delay && scache_ptr->last_split - scache_ptr->known_since > ConfigServerHide.links_delay;
5679 + show = scache_ptr->last_split > rb_current_time() - ConfigServerHide.links_delay && scache_ptr->last_split - scache_ptr->known_since > ConfigServerHide.links_delay;
5681 sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS),
5682 scache_ptr->name, me.name, 1, scache_ptr->info);
5684 scache_ptr = scache_hash[i];
5687 - if (!(scache_ptr->flags & SC_ONLINE) && scache_ptr->last_split > CurrentTime - MISSING_TIMEOUT)
5688 + if (!(scache_ptr->flags & SC_ONLINE) && scache_ptr->last_split > rb_current_time() - MISSING_TIMEOUT)
5689 sendto_one_numeric(source_p, RPL_MAP, "** %s (recently split)",
5692 diff -r a44630997728 src/send.c
5693 --- a/src/send.c Wed Apr 02 00:10:51 2008 +0200
5694 +++ b/src/send.c Wed Apr 02 04:03:18 2008 +0400
5701 #include "channel.h"
5704 #include "irc_string.h"
5706 #include "numeric.h"
5707 -#include "commio.h"
5709 #include "sprintf_irc.h"
5711 #include "s_newconf.h"
5712 -#include "linebuf.h"
5714 -#include "memory.h"
5716 #include "monitor.h"
5721 to->localClient->slinkq_ofs = 0;
5722 - MyFree(to->localClient->slinkq);
5723 + rb_free(to->localClient->slinkq);
5724 to->localClient->slinkq = NULL;
5727 diff -r a44630997728 src/substitution.c
5728 --- a/src/substitution.c Wed Apr 02 00:10:51 2008 +0200
5729 +++ b/src/substitution.c Wed Apr 02 04:03:18 2008 +0400
5735 -#include "balloc.h"
5737 #include "irc_string.h"
5741 void substitution_append_var(rb_dlink_list *varlist, const char *name, const char *value)
5743 - struct substitution_variable *tmp = MyMalloc(sizeof(struct substitution_variable));
5744 + struct substitution_variable *tmp = rb_malloc(sizeof(struct substitution_variable));
5746 - DupString(tmp->name, name);
5747 - DupString(tmp->value, value);
5748 + tmp->name = rb_strdup(name);
5749 + tmp->value = rb_strdup(value);
5751 rb_dlinkAddAlloc(tmp, varlist);
5754 struct substitution_variable *tmp = (struct substitution_variable *) nptr->data;
5756 rb_dlinkDelete(nptr, varlist);
5757 - MyFree(tmp->name);
5758 - MyFree(tmp->value);
5760 + rb_free(tmp->name);
5761 + rb_free(tmp->value);
5766 diff -r a44630997728 src/supported.c
5767 --- a/src/supported.c Wed Apr 02 00:10:51 2008 +0200
5768 +++ b/src/supported.c Wed Apr 02 04:03:18 2008 +0400
5776 #include "numeric.h"
5779 struct isupportitem *item;
5781 - item = MyMalloc(sizeof(struct isupportitem));
5782 + item = rb_malloc(sizeof(struct isupportitem));
5785 item->param = param;
5787 if (!strcmp(item->name, name))
5789 rb_dlinkDelete(ptr, &isupportlist);
5795 diff -r a44630997728 src/whowas.c
5796 --- a/src/whowas.c Wed Apr 02 00:10:51 2008 +0200
5797 +++ b/src/whowas.c Wed Apr 02 04:03:18 2008 +0400
5802 -#include "memory.h"
5805 /* internally defined function */
5807 del_whowas_from_list(&WHOWASHASH[who->hashv], who);
5809 who->hashv = hash_whowas_name(client_p->name);
5810 - who->logoff = CurrentTime;
5811 + who->logoff = rb_current_time();
5813 * NOTE: strcpy ok here, the sizes in the client struct MUST
5814 * match the sizes in the whowas struct
5816 struct Whowas *temp;
5819 - timelimit = CurrentTime - timelimit;
5820 + timelimit = rb_current_time() - timelimit;
5821 blah = hash_whowas_name(nick);
5822 temp = WHOWASHASH[blah];
5823 for (; temp; temp = temp->next)