]>
Commit | Line | Data |
---|---|---|
433a2029 VY |
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 | |
4 | @@ -46,7 +46,7 @@ | |
5 | # the system one. | |
6 | #CFLAGS= -DNDEBUG -g -O2 -D"FD_SETSIZE=1024" | |
7 | SHELL=/bin/sh | |
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 | |
12 | ||
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 | |
16 | @@ -1233,7 +1233,6 @@ | |
17 | ||
18 | AC_CONFIG_FILES( \ | |
19 | Makefile \ | |
20 | - libcharybdis/Makefile \ | |
21 | servlink/Makefile \ | |
22 | extensions/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 | |
27 | @@ -23,7 +23,7 @@ | |
28 | ||
29 | IRCDLIBS = @LIBS@ $(SSL_LIBS) | |
30 | ||
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@ | |
34 | ||
35 | SRCS = \ | |
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 | |
39 | @@ -14,7 +14,6 @@ | |
40 | #include "send.h" | |
41 | #include "numeric.h" | |
42 | #include "hostmask.h" | |
43 | -#include "event.h" | |
44 | #include "s_conf.h" | |
45 | #include "s_newconf.h" | |
46 | #include "hash.h" | |
47 | @@ -32,7 +31,7 @@ | |
48 | typedef struct _hurt_state { | |
49 | time_t start_time; | |
50 | uint32_t n_hurts; | |
51 | - dlink_list hurt_clients; | |
52 | + rb_dlink_list hurt_clients; | |
53 | uint16_t cutoff; | |
54 | time_t default_expire; | |
55 | const char *exit_reason; | |
56 | @@ -78,7 +77,7 @@ | |
57 | ||
58 | /* {{{ State containers */ | |
59 | ||
60 | -dlink_list hurt_confs = { NULL, NULL, 0 }; | |
61 | +rb_dlink_list hurt_confs = { NULL, NULL, 0 }; | |
62 | ||
63 | /* }}} */ | |
64 | ||
65 | @@ -152,15 +151,15 @@ | |
66 | static void | |
67 | modfini(void) | |
68 | { | |
69 | - dlink_node *ptr, *next_ptr; | |
70 | + rb_dlink_node *ptr, *next_ptr; | |
71 | ||
72 | /* and delete our events. */ | |
73 | rb_event_delete(hurt_expire_ev); | |
74 | rb_event_delete(hurt_check_ev); | |
75 | ||
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) | |
78 | { | |
79 | - dlinkDestroy(ptr, &hurt_state.hurt_clients); | |
80 | + rb_dlinkDestroy(ptr, &hurt_state.hurt_clients); | |
81 | } | |
82 | } | |
83 | /* }}} */ | |
84 | @@ -392,14 +391,14 @@ | |
85 | static void | |
86 | hurt_check_event(void *arg) | |
87 | { | |
88 | - dlink_node *ptr, *next_ptr; | |
89 | + rb_dlink_node *ptr, *next_ptr; | |
90 | struct Client *client_p; | |
91 | ||
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) { | |
94 | client_p = ptr->data; | |
95 | if (!EmptyString(client_p->user->suser)) | |
96 | { | |
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 @@ | |
103 | static void | |
104 | hurt_expire_event(void *unused) | |
105 | { | |
106 | - dlink_node *ptr, *next_ptr; | |
107 | + rb_dlink_node *ptr, *next_ptr; | |
108 | hurt_t *hurt; | |
109 | ||
110 | - DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head) | |
111 | + RB_DLINK_FOREACH_SAFE (ptr, next_ptr, hurt_confs.head) | |
112 | { | |
113 | hurt = (hurt_t *) ptr->data; | |
114 | ||
115 | if (hurt->expire <= CurrentTime) | |
116 | { | |
117 | - dlinkFindDestroy(hurt, &hurt_confs); | |
118 | + rb_dlinkFindDestroy(hurt, &hurt_confs); | |
119 | hurt_destroy(hurt); | |
120 | } | |
121 | } | |
122 | @@ -441,7 +440,7 @@ | |
123 | s_assert(data != NULL); | |
124 | s_assert(data->target != NULL); | |
125 | ||
126 | - dlinkFindDestroy(data->target, &hurt_state.hurt_clients); | |
127 | + rb_dlinkFindDestroy(data->target, &hurt_state.hurt_clients); | |
128 | } | |
129 | /* }}} */ | |
130 | ||
131 | @@ -458,7 +457,7 @@ | |
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."); | |
138 | } | |
139 | } | |
140 | @@ -468,7 +467,7 @@ | |
141 | static void | |
142 | doing_stats_hook(hook_data_int *hdata) | |
143 | { | |
144 | - dlink_node *ptr; | |
145 | + rb_dlink_node *ptr; | |
146 | hurt_t *hurt; | |
147 | struct Client *source_p; | |
148 | ||
149 | @@ -502,7 +501,7 @@ | |
150 | return; | |
151 | } | |
152 | ||
153 | - DLINK_FOREACH(ptr, hurt_confs.head) | |
154 | + RB_DLINK_FOREACH(ptr, hurt_confs.head) | |
155 | { | |
156 | hurt = (hurt_t *) ptr->data; | |
157 | sendto_one_numeric(source_p, RPL_STATSKLINE, | |
158 | @@ -543,10 +542,10 @@ | |
159 | { | |
160 | hurt_t *hurt; | |
161 | ||
162 | - hurt = MyMalloc(sizeof(hurt_t)); | |
163 | + hurt = rb_malloc(sizeof(hurt_t)); | |
164 | ||
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; | |
170 | ||
171 | return hurt; | |
172 | @@ -563,25 +562,25 @@ | |
173 | return; | |
174 | ||
175 | h = (hurt_t *) hurt; | |
176 | - MyFree(h->ip); | |
177 | - MyFree(h->reason); | |
178 | - MyFree(h); | |
179 | + rb_free(h->ip); | |
180 | + rb_free(h->reason); | |
181 | + rb_free(h); | |
182 | } | |
183 | /* }}} */ | |
184 | ||
185 | static void | |
186 | hurt_add(hurt_t *hurt) | |
187 | { | |
188 | - dlinkAddAlloc(hurt, &hurt_confs); | |
189 | + rb_dlinkAddAlloc(hurt, &hurt_confs); | |
190 | } | |
191 | ||
192 | static hurt_t * | |
193 | hurt_find_exact(const char *ip) | |
194 | { | |
195 | - dlink_node *ptr; | |
196 | + rb_dlink_node *ptr; | |
197 | hurt_t *hurt; | |
198 | ||
199 | - DLINK_FOREACH(ptr, hurt_confs.head) | |
200 | + RB_DLINK_FOREACH(ptr, hurt_confs.head) | |
201 | { | |
202 | hurt = (hurt_t *) ptr->data; | |
203 | ||
204 | @@ -595,10 +594,10 @@ | |
205 | static hurt_t * | |
206 | hurt_find(const char *ip) | |
207 | { | |
208 | - dlink_node *ptr; | |
209 | + rb_dlink_node *ptr; | |
210 | hurt_t *hurt; | |
211 | ||
212 | - DLINK_FOREACH(ptr, hurt_confs.head) | |
213 | + RB_DLINK_FOREACH(ptr, hurt_confs.head) | |
214 | { | |
215 | hurt = (hurt_t *) ptr->data; | |
216 | ||
217 | @@ -614,7 +613,7 @@ | |
218 | { | |
219 | hurt_t *hurt = hurt_find_exact(ip); | |
220 | ||
221 | - dlinkFindDestroy(hurt, &hurt_confs); | |
222 | + rb_dlinkFindDestroy(hurt, &hurt_confs); | |
223 | hurt_destroy(hurt); | |
224 | } | |
225 | ||
226 | @@ -622,7 +621,7 @@ | |
227 | static int | |
228 | heal_nick(struct Client *source_p, struct Client *target_p) | |
229 | { | |
230 | - if (dlinkFindDestroy(target_p, &hurt_state.hurt_clients)) | |
231 | + if (rb_dlinkFindDestroy(target_p, &hurt_state.hurt_clients)) | |
232 | { | |
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 | |
238 | @@ -3,7 +3,6 @@ | |
239 | #define INCLUDED_CACHE_H | |
240 | ||
241 | #include "client.h" | |
242 | -#include "tools.h" | |
243 | ||
244 | #define HELP_MAX 100 | |
245 | ||
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 | |
249 | @@ -26,8 +26,6 @@ | |
250 | ||
251 | #ifndef INCLUDED_class_h | |
252 | #define INCLUDED_class_h | |
253 | - | |
254 | -#include "tools.h" | |
255 | ||
256 | struct ConfItem; | |
257 | struct Client; | |
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 | |
261 | @@ -35,14 +35,12 @@ | |
262 | #endif | |
263 | ||
264 | #include "ircd_defs.h" | |
265 | -#include "linebuf.h" | |
266 | #include "channel.h" | |
267 | #include "res.h" | |
268 | #include "snomask.h" | |
269 | #include "irc_string.h" | |
270 | #include "sprintf_irc.h" | |
271 | #include "ircd.h" | |
272 | -#include "commio.h" | |
273 | ||
274 | /* other structs */ | |
275 | struct Blacklist; | |
276 | @@ -611,4 +609,7 @@ | |
277 | extern void init_uid(void); | |
278 | extern char *generate_uid(void); | |
279 | ||
280 | +void allocate_away(struct Client *);\r | |
281 | +void free_away(struct Client *); | |
282 | + | |
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 | |
287 | @@ -26,8 +26,6 @@ | |
288 | ||
289 | #ifndef INCLUDED_hash_h | |
290 | #define INCLUDED_hash_h | |
291 | - | |
292 | -#include "tools.h" | |
293 | ||
294 | struct Dictionary; | |
295 | ||
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 | |
299 | @@ -99,12 +99,6 @@ | |
300 | size_t strlcat(char *dst, const char *src, size_t siz); | |
301 | #endif | |
302 | ||
303 | -#ifdef HAVE_STRDUP | |
304 | -#define DupString(x,y) do { x = strdup(y); if(x == NULL) outofmemory(); } while(0) | |
305 | -#else | |
306 | -#define DupString(x,y) do { x = malloc(strlen(y) + 1); if(x == NULL) outofmemory(); strcpy(x, y); } while(0) | |
307 | -#endif | |
308 | - | |
309 | #ifdef HAVE_STRNDUP | |
310 | #define DupNString(x, y, len) do { x = strndup(y, len); if(x == NULL) outofmemory(); } while (0) | |
311 | #else | |
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 | |
315 | @@ -28,8 +28,6 @@ | |
316 | #define INCLUDED_ircd_h | |
317 | ||
318 | #include "config.h" | |
319 | -#include "tools.h" | |
320 | -#include "memory.h" | |
321 | ||
322 | struct Client; | |
323 | struct rb_dlink_list; | |
324 | @@ -82,11 +80,7 @@ | |
325 | extern rb_dlink_list global_client_list; | |
326 | extern struct Client *local[]; | |
327 | extern struct Counter Count; | |
328 | -#if 0 | |
329 | -extern time_t CurrentTime; | |
330 | -#endif | |
331 | extern struct timeval SystemTime; | |
332 | -#define CurrentTime SystemTime.tv_sec | |
333 | extern int default_server_capabs; | |
334 | ||
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 | |
339 | @@ -40,7 +40,6 @@ | |
340 | #endif | |
341 | ||
342 | #include "msg.h" | |
343 | -#include "memory.h" | |
344 | #include "hook.h" | |
345 | ||
346 | struct module | |
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 | |
350 | @@ -10,6 +10,8 @@ | |
351 | #ifndef INCLUDED_monitor_h | |
352 | #define INCLUDED_monitor_h | |
353 | ||
354 | +struct BlockHeap; | |
355 | + | |
356 | struct monitor | |
357 | { | |
358 | struct monitor *hnext; | |
359 | @@ -17,10 +19,12 @@ | |
360 | rb_dlink_list users; | |
361 | }; | |
362 | ||
363 | -extern BlockHeap *monitor_heap; | |
364 | +extern struct monitor *monitorTable[];\r | |
365 | +\r | |
366 | +#define MONITOR_HASH_BITS 16\r | |
367 | +#define MONITOR_HASH_SIZE (1<<MONITOR_HASH_BITS) | |
368 | ||
369 | -#define MONITOR_HASH_SIZE 65536 | |
370 | -#define MONITOR_HASH_BITS 16 | |
371 | +void free_monitor(struct monitor *); | |
372 | ||
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 | |
378 | @@ -10,7 +10,6 @@ | |
379 | ||
380 | #include <stdio.h> | |
381 | ||
382 | -#include "tools.h" | |
383 | #include "client.h" | |
384 | ||
385 | struct ConfEntry | |
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 | |
389 | @@ -27,8 +27,6 @@ | |
390 | #ifndef INCLUDED_packet_h | |
391 | #define INCLUDED_packet_h | |
392 | ||
393 | -#include "commio.h" | |
394 | - | |
395 | /* | |
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 | |
401 | @@ -28,7 +28,6 @@ | |
402 | #define INCLUDED_parse_h_h | |
403 | ||
404 | #include "irc_dictionary.h" | |
405 | -#include "tools.h" | |
406 | ||
407 | struct Message; | |
408 | struct Client; | |
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 | |
412 | @@ -9,7 +9,6 @@ | |
413 | ||
414 | #include "ircd_defs.h" | |
415 | #include "common.h" | |
416 | -#include "commio.h" | |
417 | #include "reslib.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 | |
423 | @@ -36,7 +36,6 @@ | |
424 | #define INCLUDED_s_newconf_h | |
425 | ||
426 | #include "setup.h" | |
427 | -#include "tools.h" | |
428 | ||
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 | |
434 | @@ -38,6 +38,8 @@ | |
435 | /* The nasty global also used in s_serv.c for server bursts */ | |
436 | extern unsigned long current_serial; | |
437 | ||
438 | +extern void send_pop_queue(struct Client *); | |
439 | + | |
440 | extern void send_queued(struct Client *to); | |
441 | ||
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 | |
446 | @@ -25,6 +25,7 @@ | |
447 | ||
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 */ | |
451 | ||
452 | /* AIX requires this to be the first thing in the file. */ | |
453 | #ifdef __GNUC__ | |
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 | |
457 | @@ -34,7 +34,6 @@ | |
458 | */ | |
459 | ||
460 | #include "stdinc.h" | |
461 | -#include "tools.h" | |
462 | ||
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 | |
468 | @@ -32,7 +32,7 @@ | |
469 | # Change this later! -- adrian | |
470 | automoduledir = @moduledir@/autoload | |
471 | ||
472 | -INCLUDES = -I../include -I../libcharybdis -I../libratbox/include $(SSL_INCLUDES) | |
473 | +INCLUDES = -I../include -I../libratbox/include $(SSL_INCLUDES) | |
474 | CPPFLAGS = ${INCLUDES} @CPPFLAGS@ | |
475 | ||
476 | CORE_SRCS = \ | |
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 | |
480 | @@ -25,12 +25,10 @@ | |
481 | */ | |
482 | ||
483 | #include "stdinc.h" | |
484 | -#include "tools.h" | |
485 | #include "client.h" | |
486 | #include "ircd.h" | |
487 | #include "irc_string.h" | |
488 | #include "numeric.h" | |
489 | -#include "commio.h" | |
490 | #include "s_log.h" | |
491 | #include "s_conf.h" | |
492 | #include "send.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 | |
496 | @@ -31,7 +31,6 @@ | |
497 | #include "numeric.h" | |
498 | #include "send.h" | |
499 | #include "msg.h" | |
500 | -#include "memory.h" | |
501 | #include "modules.h" | |
502 | #include "s_log.h" | |
503 | #include "s_conf.h" | |
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 | |
507 | @@ -25,7 +25,6 @@ | |
508 | */ | |
509 | ||
510 | #include "stdinc.h" | |
511 | -#include "tools.h" | |
512 | #include "channel.h" | |
513 | #include "client.h" | |
514 | #include "common.h" | |
515 | @@ -263,7 +262,7 @@ | |
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(); | |
521 | return 0; | |
522 | } | |
523 | ||
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) | |
530 | { | |
531 | chptr->join_count = 0; | |
532 | - chptr->join_delta = CurrentTime; | |
533 | + chptr->join_delta = rb_current_time(); | |
534 | } | |
535 | chptr->join_count++; | |
536 | ||
537 | @@ -321,7 +320,7 @@ | |
538 | /* its a new channel, set +nt and burst. */ | |
539 | if(flags & CHFL_CHANOP) | |
540 | { | |
541 | - chptr->channelts = CurrentTime; | |
542 | + chptr->channelts = rb_current_time(); | |
543 | chptr->mode.mode |= MODE_TOPICLIMIT; | |
544 | chptr->mode.mode |= MODE_NOPRIVMSGS; | |
545 | ||
546 | @@ -368,7 +367,7 @@ | |
547 | channel_member_names(chptr, source_p, 1); | |
548 | ||
549 | if(successful_join_count) | |
550 | - source_p->localClient->last_join_time = CurrentTime; | |
551 | + source_p->localClient->last_join_time = rb_current_time(); | |
552 | ||
553 | hook_info.client = source_p; | |
554 | hook_info.chptr = chptr; | |
555 | @@ -495,10 +494,10 @@ | |
556 | { | |
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) | |
561 | { | |
562 | chptr->join_count = 0; | |
563 | - chptr->join_delta = CurrentTime; | |
564 | + chptr->join_delta = rb_current_time(); | |
565 | } | |
566 | chptr->join_count++; | |
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 | |
571 | @@ -25,7 +25,6 @@ | |
572 | */ | |
573 | ||
574 | #include "stdinc.h" | |
575 | -#include "tools.h" | |
576 | #include "channel.h" | |
577 | #include "client.h" | |
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 | |
582 | @@ -41,7 +41,6 @@ | |
583 | #include "msg.h" | |
584 | #include "packet.h" | |
585 | #include "send.h" | |
586 | -#include "event.h" | |
587 | #include "s_newconf.h" | |
588 | #include "s_stats.h" | |
589 | ||
590 | @@ -447,7 +446,7 @@ | |
591 | { | |
592 | /* idle time shouldnt be reset by notices --fl */ | |
593 | if(p_or_n != NOTICE) | |
594 | - source_p->localClient->last = CurrentTime; | |
595 | + source_p->localClient->last = rb_current_time(); | |
596 | } | |
597 | ||
598 | if(chptr->mode.mode & MODE_NOCOLOR) | |
599 | @@ -531,7 +530,7 @@ | |
600 | { | |
601 | /* idletime shouldnt be reset by notice --fl */ | |
602 | if(p_or_n != NOTICE) | |
603 | - source_p->localClient->last = CurrentTime; | |
604 | + source_p->localClient->last = rb_current_time(); | |
605 | } | |
606 | ||
607 | sendto_channel_flags(client_p, type, source_p, chptr, "%s %c%s :%s", | |
608 | @@ -552,12 +551,12 @@ | |
609 | { | |
610 | target = ptr->data; | |
611 | ||
612 | - if(target->expiry < CurrentTime) | |
613 | + if(target->expiry < rb_current_time()) | |
614 | { | |
615 | rb_dlinkDelete(ptr, &tgchange_list); | |
616 | rb_patricia_remove(tgchange_tree, target->pnode); | |
617 | - MyFree(target->ip); | |
618 | - MyFree(target); | |
619 | + rb_free(target->ip); | |
620 | + rb_free(target); | |
621 | } | |
622 | } | |
623 | } | |
624 | @@ -577,7 +576,7 @@ | |
625 | * | |
626 | * XXX: is this controversial? | |
627 | */ | |
628 | - if(source_p->localClient->target_last > CurrentTime && IsOper(target_p)) | |
629 | + if(source_p->localClient->target_last > rb_current_time() && IsOper(target_p)) | |
630 | return 1; | |
631 | ||
632 | hashv = fnv_hash_upper((const unsigned char *)use_id(target_p), 32); | |
633 | @@ -598,17 +597,17 @@ | |
634 | if(!IsTGChange(source_p)) | |
635 | { | |
636 | SetTGChange(source_p); | |
637 | - source_p->localClient->target_last = CurrentTime; | |
638 | + source_p->localClient->target_last = rb_current_time(); | |
639 | } | |
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)) | |
643 | { | |
644 | if(i > USED_TARGETS(source_p)) | |
645 | USED_TARGETS(source_p) = 0; | |
646 | else | |
647 | USED_TARGETS(source_p) -= i; | |
648 | ||
649 | - source_p->localClient->target_last = CurrentTime; | |
650 | + source_p->localClient->target_last = rb_current_time(); | |
651 | } | |
652 | /* cant clear any, full target list */ | |
653 | else if(USED_TARGETS(source_p) == 10) | |
654 | @@ -623,7 +622,7 @@ | |
655 | */ | |
656 | else | |
657 | { | |
658 | - source_p->localClient->target_last = CurrentTime; | |
659 | + source_p->localClient->target_last = rb_current_time(); | |
660 | SetTGChange(source_p); | |
661 | } | |
662 | ||
663 | @@ -654,7 +653,7 @@ | |
664 | /* reset idle time for message only if its not to self | |
665 | * and its not a notice */ | |
666 | if(p_or_n != NOTICE) | |
667 | - source_p->localClient->last = CurrentTime; | |
668 | + source_p->localClient->last = rb_current_time(); | |
669 | ||
670 | /* target change stuff, dont limit ctcp replies as that | |
671 | * would allow people to start filling up random users | |
672 | @@ -717,7 +716,7 @@ | |
673 | } | |
674 | ||
675 | if((target_p->localClient->last_caller_id_time + | |
676 | - ConfigFileEntry.caller_id_wait) < CurrentTime) | |
677 | + ConfigFileEntry.caller_id_wait) < rb_current_time()) | |
678 | { | |
679 | if(p_or_n != NOTICE) | |
680 | sendto_one_numeric(source_p, RPL_TARGNOTIFY, | |
681 | @@ -728,7 +727,7 @@ | |
682 | me.name, target_p->name, source_p->name, | |
683 | source_p->username, source_p->host); | |
684 | ||
685 | - target_p->localClient->last_caller_id_time = CurrentTime; | |
686 | + target_p->localClient->last_caller_id_time = rb_current_time(); | |
687 | } | |
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 @@ | |
691 | ||
692 | if(GlobalSetOptions.floodcount && MyConnect(target_p) && IsClient(source_p)) | |
693 | { | |
694 | - if((target_p->localClient->first_received_message_time + 1) < CurrentTime) | |
695 | + if((target_p->localClient->first_received_message_time + 1) < rb_current_time()) | |
696 | { | |
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) | |
703 | { | |
704 | target_p->localClient->received_number_of_privmsgs = 0; | |
705 | @@ -824,11 +823,11 @@ | |
706 | ||
707 | if(GlobalSetOptions.floodcount && MyClient(source_p)) | |
708 | { | |
709 | - if((chptr->first_received_message_time + 1) < CurrentTime) | |
710 | + if((chptr->first_received_message_time + 1) < rb_current_time()) | |
711 | { | |
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) | |
718 | { | |
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 | |
723 | @@ -25,8 +25,6 @@ | |
724 | */ | |
725 | ||
726 | #include "stdinc.h" | |
727 | -#include "tools.h" | |
728 | -#include "balloc.h" | |
729 | #include "channel.h" | |
730 | #include "client.h" | |
731 | #include "hash.h" | |
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 | |
735 | @@ -734,7 +734,7 @@ | |
736 | char note[NICKLEN + 10]; | |
737 | ||
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); | |
743 | ||
744 | @@ -774,10 +774,10 @@ | |
745 | nick, chptr->chname); | |
746 | return; | |
747 | } | |
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; | |
751 | ||
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++; | |
755 | ||
756 | if(ConfigFileEntry.anti_nick_flood && !IsOper(source_p) && | |
757 | @@ -796,10 +796,10 @@ | |
758 | if(!samenick) | |
759 | { | |
760 | /* force the TS to increase -- jilles */ | |
761 | - if (source_p->tsinfo >= CurrentTime) | |
762 | + if (source_p->tsinfo >= rb_current_time()) | |
763 | source_p->tsinfo++; | |
764 | else | |
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 */ | |
769 | if(source_p->user) | |
770 | @@ -870,7 +870,7 @@ | |
771 | /* client changing their nick - dont reset ts if its same */ | |
772 | if(!samenick) | |
773 | { | |
774 | - source_p->tsinfo = newts ? newts : CurrentTime; | |
775 | + source_p->tsinfo = newts ? newts : rb_current_time(); | |
776 | monitor_signoff(source_p); | |
777 | } | |
778 | ||
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 | |
782 | @@ -25,7 +25,6 @@ | |
783 | */ | |
784 | ||
785 | #include "stdinc.h" | |
786 | -#include "tools.h" | |
787 | #include "channel.h" | |
788 | #include "client.h" | |
789 | #include "common.h" | |
790 | @@ -128,7 +127,7 @@ | |
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())))) | |
796 | { | |
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 | |
802 | @@ -74,7 +74,7 @@ | |
803 | ||
804 | if(!IsOper(source_p) && | |
805 | (source_p->localClient->firsttime + ConfigFileEntry.anti_spam_exit_message_time) > | |
806 | - CurrentTime) | |
807 | + rb_current_time()) | |
808 | { | |
809 | exit_client(client_p, source_p, source_p, "Client Quit"); | |
810 | return 0; | |
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 | |
814 | @@ -25,10 +25,8 @@ | |
815 | */ | |
816 | ||
817 | #include "stdinc.h" | |
818 | -#include "tools.h" | |
819 | #include "client.h" /* client struct */ | |
820 | #include "common.h" /* TRUE bleah */ | |
821 | -#include "event.h" | |
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 | |
828 | @@ -25,7 +25,6 @@ | |
829 | */ | |
830 | ||
831 | #include "stdinc.h" | |
832 | -#include "tools.h" | |
833 | #include "channel.h" | |
834 | #include "client.h" | |
835 | #include "hash.h" | |
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 | |
839 | @@ -68,7 +68,7 @@ | |
840 | { | |
841 | static time_t last_used = 0L; | |
842 | ||
843 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
844 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
845 | { | |
846 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
847 | me.name, | |
848 | @@ -77,7 +77,7 @@ | |
849 | return 0; | |
850 | } | |
851 | else | |
852 | - last_used = CurrentTime; | |
853 | + last_used = rb_current_time(); | |
854 | ||
855 | do_admin(source_p); | |
856 | ||
857 | @@ -96,14 +96,14 @@ | |
858 | ||
859 | if(parc > 1) | |
860 | { | |
861 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
862 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
863 | { | |
864 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
865 | me.name, source_p->name, "ADMIN"); | |
866 | return 0; | |
867 | } | |
868 | else | |
869 | - last_used = CurrentTime; | |
870 | + last_used = rb_current_time(); | |
871 | ||
872 | if(hunt_server(client_p, source_p, ":%s ADMIN :%s", 1, parc, parv) != HUNTED_ISME) | |
873 | return 0; | |
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 | |
877 | @@ -70,71 +70,46 @@ | |
878 | static int | |
879 | m_away(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) | |
880 | { | |
881 | - char *away; | |
882 | - char *awy2; | |
883 | - | |
884 | - if(MyClient(source_p) && !IsFloodDone(source_p)) | |
885 | - flood_endgrace(source_p); | |
886 | - | |
887 | - if(!IsClient(source_p)) | |
888 | - return 0; | |
889 | - | |
890 | - away = source_p->user->away; | |
891 | - | |
892 | - if(parc < 2 || EmptyString(parv[1])) | |
893 | - { | |
894 | - /* Marking as not away */ | |
895 | - if(away) | |
896 | - { | |
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); | |
902 | - MyFree(away); | |
903 | - source_p->user->away = NULL; | |
904 | - } | |
905 | - if(MyConnect(source_p)) | |
906 | - sendto_one_numeric(source_p, RPL_UNAWAY, form_str(RPL_UNAWAY)); | |
907 | - return 0; | |
908 | - } | |
909 | - | |
910 | - /* Marking as away */ | |
911 | - | |
912 | - if(MyConnect(source_p)) | |
913 | - { | |
914 | - if(!IsOper(source_p) && | |
915 | - (CurrentTime - source_p->localClient->last_away) < ConfigFileEntry.pace_wait) | |
916 | - { | |
917 | - sendto_one(source_p, form_str(RPL_LOAD2HI), | |
918 | - me.name, source_p->name, "AWAY"); | |
919 | - return 0; | |
920 | - } | |
921 | - | |
922 | - source_p->localClient->last_away = CurrentTime; | |
923 | - } | |
924 | - | |
925 | - awy2 = LOCAL_COPY(parv[1]); | |
926 | - if(strlen(awy2) > AWAYLEN) | |
927 | - awy2[AWAYLEN] = '\0'; | |
928 | - | |
929 | - /* we now send this only if they weren't away already --is */ | |
930 | - if(!away) | |
931 | - { | |
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); | |
936 | - } | |
937 | - else | |
938 | - MyFree(away); | |
939 | - | |
940 | - DupString(away, awy2); | |
941 | - | |
942 | - source_p->user->away = away; | |
943 | - | |
944 | - if(MyConnect(source_p)) | |
945 | - sendto_one_numeric(source_p, RPL_NOWAWAY, form_str(RPL_NOWAWAY)); | |
946 | - | |
947 | + if(MyClient(source_p) && !IsFloodDone(source_p))\r | |
948 | + flood_endgrace(source_p);\r | |
949 | +\r | |
950 | + if(!IsClient(source_p))\r | |
951 | + return 0;\r | |
952 | +\r | |
953 | + if(parc < 2 || EmptyString(parv[1]))\r | |
954 | + {\r | |
955 | + /* Marking as not away */\r | |
956 | + if(source_p->user->away != NULL)\r | |
957 | + {\r | |
958 | + /* we now send this only if they were away before --is */\r | |
959 | + sendto_server(client_p, NULL, CAP_TS6, NOCAPS,\r | |
960 | + ":%s AWAY", use_id(source_p));\r | |
961 | + sendto_server(client_p, NULL, NOCAPS, CAP_TS6, \r | |
962 | + ":%s AWAY", source_p->name);\r | |
963 | + free_away(source_p);\r | |
964 | + }\r | |
965 | + if(MyConnect(source_p))\r | |
966 | + sendto_one(source_p, form_str(RPL_UNAWAY),\r | |
967 | + me.name, source_p->name);\r | |
968 | + return 0;\r | |
969 | + }\r | |
970 | +\r | |
971 | +\r | |
972 | + if(source_p->user->away == NULL)\r | |
973 | + {\r | |
974 | + allocate_away(source_p);\r | |
975 | + rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);\r | |
976 | + sendto_server(client_p, NULL, CAP_TS6, NOCAPS, \r | |
977 | + ":%s AWAY :%s", use_id(source_p), source_p->user->away);\r | |
978 | + sendto_server(client_p, NULL, NOCAPS, CAP_TS6,\r | |
979 | + ":%s AWAY :%s", source_p->name, source_p->user->away);\r | |
980 | + \r | |
981 | + } else {\r | |
982 | + rb_strlcpy(source_p->user->away, parv[1], AWAYLEN);\r | |
983 | + }\r | |
984 | + \r | |
985 | + if(MyConnect(source_p))\r | |
986 | + sendto_one(source_p, form_str(RPL_NOWAWAY), me.name, source_p->name);\r | |
987 | +\r | |
988 | return 0; | |
989 | } | |
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 | |
993 | @@ -31,7 +31,6 @@ | |
994 | */ | |
995 | ||
996 | #include "stdinc.h" | |
997 | -#include "tools.h" | |
998 | #include "class.h" | |
999 | #include "client.h" | |
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 | |
1004 | @@ -78,8 +78,8 @@ | |
1005 | else | |
1006 | client_p->localClient->caps |= CAP_CAP; | |
1007 | ||
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]); | |
1012 | ||
1013 | for (i = 1; i < parc; i++) | |
1014 | { | |
1015 | @@ -116,10 +116,10 @@ | |
1016 | if(!EmptyString(source_p->serv->fullcaps)) | |
1017 | { | |
1018 | source_p->serv->caps = 0; | |
1019 | - MyFree(source_p->serv->fullcaps); | |
1020 | + rb_free(source_p->serv->fullcaps); | |
1021 | } | |
1022 | ||
1023 | - DupString(source_p->serv->fullcaps, parv[1]); | |
1024 | + source_p->serv->fullcaps = rb_strdup(parv[1]); | |
1025 | ||
1026 | for (s = strtoken(&p, t, " "); s; s = strtoken(&p, NULL, " ")) | |
1027 | { | |
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 | |
1031 | @@ -36,7 +36,6 @@ | |
1032 | #include <openssl/err.h> | |
1033 | #endif | |
1034 | ||
1035 | -#include "memory.h" | |
1036 | #include "client.h" | |
1037 | #include "ircd.h" | |
1038 | #include "modules.h" | |
1039 | @@ -92,8 +91,8 @@ | |
1040 | if(target_p->localClient == NULL) | |
1041 | return; | |
1042 | ||
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; | |
1050 | @@ -129,7 +128,7 @@ | |
1051 | if(!source_p->localClient->challenge) | |
1052 | return 0; | |
1053 | ||
1054 | - if((CurrentTime - source_p->localClient->chal_time) > CHALLENGE_EXPIRES) | |
1055 | + if((rb_current_time() - source_p->localClient->chal_time) > CHALLENGE_EXPIRES) | |
1056 | { | |
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, | |
1061 | source_p->host); | |
1062 | ||
1063 | - MyFree(b_response); | |
1064 | + rb_free(b_response); | |
1065 | cleanup_challenge(source_p); | |
1066 | return 0; | |
1067 | } | |
1068 | ||
1069 | - MyFree(b_response); | |
1070 | + rb_free(b_response); | |
1071 | ||
1072 | oper_p = find_oper_conf(source_p->username, source_p->orighost, | |
1073 | source_p->sockhost, | |
1074 | @@ -227,7 +226,7 @@ | |
1075 | if(!generate_challenge(&challenge, &(source_p->localClient->challenge), oper_p->rsa_pubkey)) | |
1076 | { | |
1077 | char *chal = challenge; | |
1078 | - source_p->localClient->chal_time = CurrentTime; | |
1079 | + source_p->localClient->chal_time = rb_current_time(); | |
1080 | for(;;) | |
1081 | { | |
1082 | cnt = strlcpy(chal_line, chal, CHALLENGE_WIDTH); | |
1083 | @@ -240,8 +239,8 @@ | |
1084 | } | |
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); | |
1091 | } | |
1092 | else | |
1093 | sendto_one_notice(source_p, ":Failed to generate challenge."); | |
1094 | @@ -287,21 +286,21 @@ | |
1095 | { | |
1096 | SHA1_Init(&ctx); | |
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); | |
1101 | ||
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); | |
1106 | ||
1107 | if (ret >= 0) | |
1108 | { | |
1109 | *r_challenge = (char *)ircd_base64_encode(tmp, ret); | |
1110 | - MyFree(tmp); | |
1111 | + rb_free(tmp); | |
1112 | return 0; | |
1113 | } | |
1114 | - MyFree(tmp); | |
1115 | - MyFree(*r_response); | |
1116 | + rb_free(tmp); | |
1117 | + rb_free(*r_response); | |
1118 | *r_response = NULL; | |
1119 | } | |
1120 | ||
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 | |
1124 | @@ -10,7 +10,6 @@ | |
1125 | */ | |
1126 | ||
1127 | #include "stdinc.h" | |
1128 | -#include "tools.h" | |
1129 | #include "send.h" | |
1130 | #include "channel.h" | |
1131 | #include "client.h" | |
1132 | @@ -18,7 +17,6 @@ | |
1133 | #include "config.h" | |
1134 | #include "ircd.h" | |
1135 | #include "numeric.h" | |
1136 | -#include "memory.h" | |
1137 | #include "s_conf.h" | |
1138 | #include "s_newconf.h" | |
1139 | #include "s_serv.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 | |
1143 | @@ -25,11 +25,9 @@ | |
1144 | */ | |
1145 | ||
1146 | #include "stdinc.h" | |
1147 | -#include "tools.h" | |
1148 | #include "client.h" | |
1149 | #include "ircd.h" | |
1150 | #include "numeric.h" | |
1151 | -#include "commio.h" | |
1152 | #include "send.h" | |
1153 | #include "msg.h" | |
1154 | #include "parse.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 | |
1158 | @@ -143,7 +143,7 @@ | |
1159 | form_str(ERR_TARGUMODEG), target_p->name); | |
1160 | ||
1161 | if((target_p->localClient->last_caller_id_time + | |
1162 | - ConfigFileEntry.caller_id_wait) < CurrentTime) | |
1163 | + ConfigFileEntry.caller_id_wait) < rb_current_time()) | |
1164 | { | |
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); | |
1170 | ||
1171 | - target_p->localClient->last_caller_id_time = CurrentTime; | |
1172 | + target_p->localClient->last_caller_id_time = rb_current_time(); | |
1173 | } | |
1174 | ||
1175 | return 0; | |
1176 | } | |
1177 | ||
1178 | if(p_or_n != NOTICE) | |
1179 | - source_p->localClient->last = CurrentTime; | |
1180 | + source_p->localClient->last = rb_current_time(); | |
1181 | ||
1182 | sendto_anywhere(target_p, source_p, command, ":%s", parv[3]); | |
1183 | return 0; | |
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 | |
1187 | @@ -29,7 +29,6 @@ | |
1188 | #include "ircd.h" | |
1189 | #include "irc_string.h" | |
1190 | #include "numeric.h" | |
1191 | -#include "commio.h" | |
1192 | #include "s_conf.h" | |
1193 | #include "s_newconf.h" | |
1194 | #include "s_log.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 | |
1198 | @@ -25,7 +25,6 @@ | |
1199 | */ | |
1200 | ||
1201 | #include "stdinc.h" | |
1202 | -#include "tools.h" | |
1203 | #include "channel.h" | |
1204 | #include "class.h" | |
1205 | #include "client.h" | |
1206 | @@ -35,7 +34,6 @@ | |
1207 | #include "ircd.h" | |
1208 | #include "hostmask.h" | |
1209 | #include "numeric.h" | |
1210 | -#include "commio.h" | |
1211 | #include "s_conf.h" | |
1212 | #include "s_newconf.h" | |
1213 | #include "s_log.h" | |
1214 | @@ -188,7 +186,7 @@ | |
1215 | ||
1216 | aconf = make_conf(); | |
1217 | aconf->status = CONF_DLINE; | |
1218 | - DupString(aconf->host, dlhost); | |
1219 | + aconf->host = rb_strdup(dlhost); | |
1220 | ||
1221 | /* Look for an oper reason */ | |
1222 | if((oper_reason = strchr(reason, '|')) != NULL) | |
1223 | @@ -197,7 +195,7 @@ | |
1224 | oper_reason++; | |
1225 | ||
1226 | if(!EmptyString(oper_reason)) | |
1227 | - DupString(aconf->spasswd, oper_reason); | |
1228 | + aconf->spasswd = rb_strdup(oper_reason); | |
1229 | } | |
1230 | ||
1231 | if(tdline_time > 0) | |
1232 | @@ -205,8 +203,8 @@ | |
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); | |
1241 | ||
1242 | if(EmptyString(oper_reason)) | |
1243 | @@ -236,7 +234,7 @@ | |
1244 | else | |
1245 | { | |
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 | |
1255 | @@ -30,7 +30,6 @@ | |
1256 | */ | |
1257 | ||
1258 | #include "stdinc.h" | |
1259 | -#include "tools.h" | |
1260 | #include "send.h" | |
1261 | #include "channel.h" | |
1262 | #include "client.h" | |
1263 | @@ -38,7 +37,6 @@ | |
1264 | #include "config.h" | |
1265 | #include "ircd.h" | |
1266 | #include "numeric.h" | |
1267 | -#include "memory.h" | |
1268 | #include "s_serv.h" | |
1269 | #include "hash.h" | |
1270 | #include "msg.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 | |
1274 | @@ -42,7 +42,6 @@ | |
1275 | #include "irc_string.h" | |
1276 | #include "ircd.h" | |
1277 | #include "numeric.h" | |
1278 | -#include "commio.h" | |
1279 | #include "s_serv.h" | |
1280 | #include "s_conf.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 | |
1285 | @@ -25,7 +25,6 @@ | |
1286 | */ | |
1287 | ||
1288 | #include "stdinc.h" | |
1289 | -#include "tools.h" | |
1290 | #include "s_gline.h" | |
1291 | #include "channel.h" | |
1292 | #include "client.h" | |
1293 | @@ -36,7 +35,6 @@ | |
1294 | #include "ircd.h" | |
1295 | #include "hostmask.h" | |
1296 | #include "numeric.h" | |
1297 | -#include "commio.h" | |
1298 | #include "s_conf.h" | |
1299 | #include "s_newconf.h" | |
1300 | #include "scache.h" | |
1301 | @@ -556,15 +554,15 @@ | |
1302 | oper_reason++; | |
1303 | ||
1304 | if(!EmptyString(oper_reason)) | |
1305 | - DupString(aconf->spasswd, oper_reason); | |
1306 | + aconf->spasswd = rb_strdup(oper_reason); | |
1307 | } | |
1308 | ||
1309 | rb_snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date); | |
1310 | ||
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; | |
1319 | add_gline(aconf); | |
1320 | ||
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(); | |
1333 | return NO; | |
1334 | } | |
1335 | } | |
1336 | @@ -662,7 +660,7 @@ | |
1337 | ||
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)); | |
1342 | ||
1343 | strlcpy(pending->oper_nick1, source_p->name, | |
1344 | sizeof(pending->oper_nick1)); | |
1345 | @@ -675,11 +673,11 @@ | |
1346 | ||
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; | |
1352 | ||
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(); | |
1357 | ||
1358 | rb_dlinkAddAlloc(pending, &pending_glines); | |
1359 | ||
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 | |
1363 | @@ -25,7 +25,6 @@ | |
1364 | */ | |
1365 | ||
1366 | #include "stdinc.h" | |
1367 | -#include "tools.h" | |
1368 | #include "m_info.h" | |
1369 | #include "channel.h" | |
1370 | #include "client.h" | |
1371 | @@ -624,7 +623,7 @@ | |
1372 | { | |
1373 | static time_t last_used = 0L; | |
1374 | ||
1375 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
1376 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
1377 | { | |
1378 | /* safe enough to give this on a local connect only */ | |
1379 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
1380 | @@ -633,7 +632,7 @@ | |
1381 | return 0; | |
1382 | } | |
1383 | else | |
1384 | - last_used = CurrentTime; | |
1385 | + last_used = rb_current_time(); | |
1386 | ||
1387 | if(hunt_server(client_p, source_p, ":%s INFO :%s", 1, parc, parv) != HUNTED_ISME) | |
1388 | return 0; | |
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 | |
1392 | @@ -25,7 +25,6 @@ | |
1393 | */ | |
1394 | ||
1395 | #include "stdinc.h" | |
1396 | -#include "tools.h" | |
1397 | #include "common.h" | |
1398 | #include "channel.h" | |
1399 | #include "client.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 | |
1403 | @@ -25,7 +25,6 @@ | |
1404 | */ | |
1405 | ||
1406 | #include "stdinc.h" | |
1407 | -#include "tools.h" | |
1408 | #include "channel.h" | |
1409 | #include "class.h" | |
1410 | #include "client.h" | |
1411 | @@ -35,7 +34,6 @@ | |
1412 | #include "ircd.h" | |
1413 | #include "hostmask.h" | |
1414 | #include "numeric.h" | |
1415 | -#include "commio.h" | |
1416 | #include "s_conf.h" | |
1417 | #include "s_newconf.h" | |
1418 | #include "s_log.h" | |
1419 | @@ -45,7 +43,6 @@ | |
1420 | #include "msg.h" | |
1421 | #include "parse.h" | |
1422 | #include "modules.h" | |
1423 | -#include "event.h" | |
1424 | #include "reject.h" | |
1425 | ||
1426 | static int mo_kline(struct Client *, struct Client *, int, const char **); | |
1427 | @@ -181,8 +178,8 @@ | |
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); | |
1435 | aconf->port = 0; | |
1436 | ||
1437 | /* Look for an oper reason */ | |
1438 | @@ -192,7 +189,7 @@ | |
1439 | oper_reason++; | |
1440 | ||
1441 | if(!EmptyString(oper_reason)) | |
1442 | - DupString(aconf->spasswd, oper_reason); | |
1443 | + aconf->spasswd = rb_strdup(oper_reason); | |
1444 | } | |
1445 | ||
1446 | if(tkline_time > 0) | |
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); | |
1454 | } | |
1455 | else | |
1456 | { | |
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); | |
1461 | } | |
1462 | ||
1463 | @@ -296,8 +293,8 @@ | |
1464 | aconf = make_conf(); | |
1465 | ||
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); | |
1471 | ||
1472 | /* Look for an oper reason */ | |
1473 | if((oper_reason = strchr(reason, '|')) != NULL) | |
1474 | @@ -306,7 +303,7 @@ | |
1475 | oper_reason++; | |
1476 | ||
1477 | if(!EmptyString(oper_reason)) | |
1478 | - DupString(aconf->spasswd, oper_reason); | |
1479 | + aconf->spasswd = rb_strdup(oper_reason); | |
1480 | } | |
1481 | ||
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); | |
1490 | } | |
1491 | else | |
1492 | { | |
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); | |
1497 | } | |
1498 | ||
1499 | @@ -511,7 +508,7 @@ | |
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) | |
1502 | { | |
1503 | - aconf->hold = CurrentTime + tkline_time; | |
1504 | + aconf->hold = rb_current_time() + tkline_time; | |
1505 | add_temp_kline(aconf); | |
1506 | ||
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 | |
1511 | @@ -25,7 +25,6 @@ | |
1512 | ||
1513 | #include "stdinc.h" | |
1514 | #include "sprintf_irc.h" | |
1515 | -#include "tools.h" | |
1516 | #include "channel.h" | |
1517 | #include "client.h" | |
1518 | #include "hash.h" | |
1519 | @@ -138,13 +137,13 @@ | |
1520 | * allow one knock per channel per knock_delay_channel | |
1521 | */ | |
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()) | |
1525 | { | |
1526 | sendto_one(source_p, form_str(ERR_TOOMANYKNOCK), | |
1527 | me.name, source_p->name, name, "user"); | |
1528 | return 0; | |
1529 | } | |
1530 | - else if((chptr->last_knock + ConfigChannel.knock_delay_channel) > CurrentTime) | |
1531 | + else if((chptr->last_knock + ConfigChannel.knock_delay_channel) > rb_current_time()) | |
1532 | { | |
1533 | sendto_one(source_p, form_str(ERR_TOOMANYKNOCK), | |
1534 | me.name, source_p->name, name, "channel"); | |
1535 | @@ -152,13 +151,13 @@ | |
1536 | } | |
1537 | ||
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(); | |
1541 | ||
1542 | sendto_one(source_p, form_str(RPL_KNOCKDLVR), | |
1543 | me.name, source_p->name, name); | |
1544 | } | |
1545 | ||
1546 | - chptr->last_knock = CurrentTime; | |
1547 | + chptr->last_knock = rb_current_time(); | |
1548 | ||
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 | |
1554 | @@ -34,7 +34,6 @@ | |
1555 | */ | |
1556 | ||
1557 | #include "stdinc.h" | |
1558 | -#include "tools.h" | |
1559 | #include "channel.h" | |
1560 | #include "client.h" | |
1561 | #include "hash.h" | |
1562 | @@ -47,7 +46,6 @@ | |
1563 | #include "msg.h" | |
1564 | #include "parse.h" | |
1565 | #include "modules.h" | |
1566 | -#include "event.h" | |
1567 | ||
1568 | static rb_dlink_list safelisting_clients = { NULL, NULL, 0 }; | |
1569 | ||
1570 | @@ -126,14 +124,14 @@ | |
1571 | if (parc < 2 || !IsChannelName(parv[1])) | |
1572 | { | |
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())) | |
1576 | { | |
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); | |
1579 | return 0; | |
1580 | } | |
1581 | else | |
1582 | - last_used = CurrentTime; | |
1583 | + last_used = rb_current_time(); | |
1584 | } | |
1585 | ||
1586 | return mo_list(client_p, source_p, parc, parv); | |
1587 | @@ -251,7 +249,7 @@ | |
1588 | s_assert(MyClient(client_p)); | |
1589 | s_assert(params != NULL); | |
1590 | ||
1591 | - self = MyMalloc(sizeof(struct ListClient)); | |
1592 | + self = rb_malloc(sizeof(struct ListClient)); | |
1593 | ||
1594 | self->hash_indice = 0; | |
1595 | self->users_min = params->users_min; | |
1596 | @@ -285,7 +283,7 @@ | |
1597 | ||
1598 | rb_dlinkFindDestroy(client_p, &safelisting_clients); | |
1599 | ||
1600 | - MyFree(client_p->localClient->safelist_data); | |
1601 | + rb_free(client_p->localClient->safelist_data); | |
1602 | ||
1603 | client_p->localClient->safelist_data = NULL; | |
1604 | ||
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 | |
1608 | @@ -63,7 +63,7 @@ | |
1609 | ||
1610 | if (parc > 2) | |
1611 | { | |
1612 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
1613 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
1614 | { | |
1615 | /* safe enough to give this on a local connect only */ | |
1616 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
1617 | @@ -71,7 +71,7 @@ | |
1618 | return 0; | |
1619 | } | |
1620 | else | |
1621 | - last_used = CurrentTime; | |
1622 | + last_used = rb_current_time(); | |
1623 | ||
1624 | if(hunt_server(client_p, source_p, ":%s LUSERS %s :%s", 2, parc, parv) != | |
1625 | HUNTED_ISME) | |
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 | |
1629 | @@ -31,7 +31,6 @@ | |
1630 | */ | |
1631 | ||
1632 | #include "stdinc.h" | |
1633 | -#include "tools.h" | |
1634 | #include "client.h" | |
1635 | #include "msg.h" | |
1636 | #include "parse.h" | |
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 | |
1640 | @@ -26,7 +26,6 @@ | |
1641 | ||
1642 | #include "stdinc.h" | |
1643 | #include "client.h" | |
1644 | -#include "tools.h" | |
1645 | #include "ircd.h" | |
1646 | #include "send.h" | |
1647 | #include "numeric.h" | |
1648 | @@ -68,7 +67,7 @@ | |
1649 | { | |
1650 | static time_t last_used = 0; | |
1651 | ||
1652 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
1653 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
1654 | { | |
1655 | /* safe enough to give this on a local connect only */ | |
1656 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
1657 | @@ -78,7 +77,7 @@ | |
1658 | return 0; | |
1659 | } | |
1660 | else | |
1661 | - last_used = CurrentTime; | |
1662 | + last_used = rb_current_time(); | |
1663 | ||
1664 | if(hunt_server(client_p, source_p, ":%s MOTD :%s", 1, parc, parv) != HUNTED_ISME) | |
1665 | return 0; | |
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 | |
1669 | @@ -26,7 +26,6 @@ | |
1670 | ||
1671 | #include "stdinc.h" | |
1672 | #include "sprintf_irc.h" | |
1673 | -#include "tools.h" | |
1674 | #include "channel.h" | |
1675 | #include "client.h" | |
1676 | #include "common.h" | |
1677 | @@ -93,7 +92,7 @@ | |
1678 | { | |
1679 | if(!IsOper(source_p)) | |
1680 | { | |
1681 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
1682 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
1683 | { | |
1684 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
1685 | me.name, source_p->name, "NAMES"); | |
1686 | @@ -102,7 +101,7 @@ | |
1687 | return 0; | |
1688 | } | |
1689 | else | |
1690 | - last_used = CurrentTime; | |
1691 | + last_used = rb_current_time(); | |
1692 | } | |
1693 | ||
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 | |
1698 | @@ -25,13 +25,11 @@ | |
1699 | */ | |
1700 | ||
1701 | #include "stdinc.h" | |
1702 | -#include "tools.h" | |
1703 | #include "client.h" | |
1704 | #include "common.h" | |
1705 | #include "irc_string.h" | |
1706 | #include "ircd.h" | |
1707 | #include "numeric.h" | |
1708 | -#include "commio.h" | |
1709 | #include "s_conf.h" | |
1710 | #include "s_newconf.h" | |
1711 | #include "s_log.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 | |
1715 | @@ -30,7 +30,6 @@ | |
1716 | */ | |
1717 | ||
1718 | #include "stdinc.h" | |
1719 | -#include "tools.h" | |
1720 | #include "send.h" | |
1721 | #include "channel.h" | |
1722 | #include "client.h" | |
1723 | @@ -38,7 +37,6 @@ | |
1724 | #include "config.h" | |
1725 | #include "ircd.h" | |
1726 | #include "numeric.h" | |
1727 | -#include "memory.h" | |
1728 | #include "s_serv.h" | |
1729 | #include "hash.h" | |
1730 | #include "msg.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 | |
1734 | @@ -64,7 +64,7 @@ | |
1735 | { | |
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); | |
1740 | } | |
1741 | ||
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 | |
1746 | @@ -89,7 +89,7 @@ | |
1747 | sendto_realops_snomask(SNO_GENERAL, L_ALL, | |
1748 | "End of burst (emulated) from %s (%d seconds)", | |
1749 | source_p->name, | |
1750 | - (signed int) (CurrentTime - source_p->localClient->firsttime)); | |
1751 | + (signed int) (rb_current_time() - source_p->localClient->firsttime)); | |
1752 | SetEob(source_p); | |
1753 | eob_count++; | |
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 | |
1758 | @@ -136,9 +136,9 @@ | |
1759 | { | |
1760 | glp_ptr = ptr->data; | |
1761 | ||
1762 | - MyFree(glp_ptr->reason1); | |
1763 | - MyFree(glp_ptr->reason2); | |
1764 | - MyFree(glp_ptr); | |
1765 | + rb_free(glp_ptr->reason1); | |
1766 | + rb_free(glp_ptr->reason2); | |
1767 | + rb_free(glp_ptr); | |
1768 | rb_dlinkDestroy(ptr, &pending_glines); | |
1769 | } | |
1770 | } | |
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; | |
1777 | aconf->port = 0; | |
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); | |
1783 | ||
1784 | if(temp_time > 0) | |
1785 | { | |
1786 | - aconf->hold = CurrentTime + temp_time; | |
1787 | + aconf->hold = rb_current_time() + temp_time; | |
1788 | ||
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; | |
1794 | aconf->port = 0; | |
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); | |
1800 | ||
1801 | if(temp_time > 0) | |
1802 | { | |
1803 | - aconf->hold = CurrentTime + temp_time; | |
1804 | + aconf->hold = rb_current_time() + temp_time; | |
1805 | ||
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 | |
1811 | @@ -41,7 +41,6 @@ | |
1812 | #include "irc_string.h" | |
1813 | #include "ircd.h" | |
1814 | #include "numeric.h" | |
1815 | -#include "commio.h" | |
1816 | #include "s_serv.h" | |
1817 | #include "s_conf.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 | |
1822 | @@ -31,7 +31,6 @@ | |
1823 | ||
1824 | #include "stdinc.h" | |
1825 | ||
1826 | -#include "tools.h" | |
1827 | #include "send.h" | |
1828 | #include "channel.h" | |
1829 | #include "client.h" | |
1830 | @@ -39,7 +38,6 @@ | |
1831 | #include "config.h" | |
1832 | #include "ircd.h" | |
1833 | #include "numeric.h" | |
1834 | -#include "memory.h" | |
1835 | #include "s_conf.h" | |
1836 | #include "s_newconf.h" | |
1837 | #include "s_serv.h" | |
1838 | @@ -206,8 +204,8 @@ | |
1839 | newts = atol(parv[3]); | |
1840 | ||
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; | |
1846 | ||
1847 | target_p->tsinfo = newts; | |
1848 | ||
1849 | @@ -272,7 +270,7 @@ | |
1850 | add_nd_entry(parv[2]); | |
1851 | nd = irc_dictionary_retrieve(nd_dict, parv[2]); | |
1852 | if (nd != NULL) | |
1853 | - nd->expire = CurrentTime + duration; | |
1854 | + nd->expire = rb_current_time() + duration; | |
1855 | } | |
1856 | ||
1857 | return 0; | |
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 | |
1861 | @@ -28,12 +28,10 @@ | |
1862 | ||
1863 | #include "stdinc.h" | |
1864 | #include "client.h" | |
1865 | -#include "event.h" | |
1866 | #include "irc_string.h" | |
1867 | #include "sprintf_irc.h" | |
1868 | #include "ircd.h" | |
1869 | #include "numeric.h" | |
1870 | -#include "commio.h" | |
1871 | #include "s_serv.h" | |
1872 | #include "send.h" | |
1873 | #include "common.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 | |
1877 | @@ -31,7 +31,6 @@ | |
1878 | ||
1879 | #include "stdinc.h" | |
1880 | ||
1881 | -#include "tools.h" | |
1882 | #include "send.h" | |
1883 | #include "channel.h" | |
1884 | #include "client.h" | |
1885 | @@ -39,7 +38,6 @@ | |
1886 | #include "config.h" | |
1887 | #include "ircd.h" | |
1888 | #include "numeric.h" | |
1889 | -#include "memory.h" | |
1890 | #include "s_conf.h" | |
1891 | #include "s_serv.h" | |
1892 | #include "hash.h" | |
1893 | @@ -259,7 +257,7 @@ | |
1894 | { | |
1895 | char note[NICKLEN + 10]; | |
1896 | ||
1897 | - send_signon(NULL, target_p, nick, user, host, CurrentTime, login); | |
1898 | + send_signon(NULL, target_p, nick, user, host, rb_current_time(), login); | |
1899 | ||
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 | |
1905 | @@ -41,7 +41,6 @@ | |
1906 | #include "irc_string.h" | |
1907 | #include "ircd.h" | |
1908 | #include "numeric.h" | |
1909 | -#include "commio.h" | |
1910 | #include "s_serv.h" | |
1911 | #include "s_conf.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 | |
1916 | @@ -25,7 +25,6 @@ | |
1917 | */ | |
1918 | ||
1919 | #include "stdinc.h" | |
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 */ | |
1924 | @@ -38,14 +37,11 @@ | |
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" | |
1936 | #include "parse.h" | |
1937 | #include "modules.h" | |
1938 | #include "hook.h" | |
1939 | @@ -122,7 +118,7 @@ | |
1940 | static void stats_servlinks(struct Client *); | |
1941 | static void stats_ltrace(struct Client *, int, const char **); | |
1942 | static void stats_ziplinks(struct Client *); | |
1943 | - | |
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_ | |
1948 | @@ -139,8 +135,8 @@ | |
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, }, | |
1959 | @@ -199,7 +195,7 @@ | |
1960 | if(MyClient(source_p) && !IsOper(source_p)) | |
1961 | { | |
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()) | |
1965 | { | |
1966 | /* safe enough to give this on a local connect only */ | |
1967 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
1968 | @@ -209,7 +205,7 @@ | |
1969 | return 0; | |
1970 | } | |
1971 | else | |
1972 | - last_used = CurrentTime; | |
1973 | + last_used = rb_current_time(); | |
1974 | } | |
1975 | ||
1976 | if(hunt_server (client_p, source_p, ":%s STATS %s :%s", 2, parc, parv) != HUNTED_ISME) | |
1977 | @@ -447,10 +443,17 @@ | |
1978 | }} | |
1979 | ||
1980 | ||
1981 | -static void | |
1982 | -stats_events (struct Client *source_p) | |
1983 | -{ | |
1984 | - show_events (source_p); | |
1985 | +static void\r | |
1986 | +stats_events_cb(char *str, void *ptr)\r | |
1987 | +{\r | |
1988 | + sendto_one_numeric(ptr, RPL_STATSDEBUG, "E :%s", str);\r | |
1989 | +}\r | |
1990 | +\r | |
1991 | +static void\r | |
1992 | +stats_events (struct Client *source_p)\r | |
1993 | +{\r | |
1994 | + rb_dump_events(stats_events_cb, source_p);\r | |
1995 | + send_pop_queue(source_p);\r | |
1996 | } | |
1997 | ||
1998 | /* stats_pending_glines() | |
1999 | @@ -891,7 +894,7 @@ | |
2000 | if(0 == secs) | |
2001 | secs = 1; | |
2002 | ||
2003 | - rup = (CurrentTime - startup_time) * hzz; | |
2004 | + rup = (rb_current_time() - startup_time) * hzz; | |
2005 | if(0 == rup) | |
2006 | rup = 1; | |
2007 | ||
2008 | @@ -932,7 +935,7 @@ | |
2009 | { | |
2010 | time_t now; | |
2011 | ||
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; | |
2019 | ||
2020 | j++; | |
2021 | - seconds = CurrentTime - target_p->localClient->firsttime; | |
2022 | + seconds = rb_current_time() - target_p->localClient->firsttime; | |
2023 | ||
2024 | days = (int) (seconds / 86400); | |
2025 | seconds %= 86400; | |
2026 | @@ -1060,8 +1063,8 @@ | |
2027 | "Connected: %d day%s, %d:%02d:%02d", | |
2028 | target_p->name, | |
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, | |
2035 | (int) seconds); | |
2036 | } | |
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"); | |
2054 | } | |
2055 | ||
2056 | @@ -1207,7 +1210,7 @@ | |
2057 | "? :Recv total : %7.2f %s", | |
2058 | _GMKv (receiveK), _GMKs (receiveK)); | |
2059 | ||
2060 | - uptime = (CurrentTime - startup_time); | |
2061 | + uptime = (rb_current_time() - startup_time); | |
2062 | ||
2063 | sendto_one_numeric(source_p, RPL_STATSDEBUG, | |
2064 | "? :Server send: %7.2f %s (%4.1f K/s)", | |
2065 | @@ -1339,14 +1342,14 @@ | |
2066 | { | |
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) : "-"); | |
2082 | } | |
2083 | ||
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, | |
2100 | "-"); | |
2101 | } | |
2102 | +} | |
2103 | + | |
2104 | +static void\r | |
2105 | +rb_dump_fd_callback(int fd, const char *desc, void *data)\r | |
2106 | +{\r | |
2107 | + struct Client *source_p = data;\r | |
2108 | + sendto_one_numeric(source_p, RPL_STATSDEBUG, "F :fd %-3d desc '%s'", fd, desc);\r | |
2109 | +}\r | |
2110 | +\r | |
2111 | +static void\r | |
2112 | +stats_comm(struct Client *source_p)\r | |
2113 | +{\r | |
2114 | + rb_dump_fd(rb_dump_fd_callback, source_p);\r | |
2115 | + send_pop_queue(source_p);\r | |
2116 | } | |
2117 | ||
2118 | /* | |
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 | |
2122 | @@ -78,11 +78,11 @@ | |
2123 | } | |
2124 | ||
2125 | /* | |
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 | |
2128 | */ | |
2129 | set_time(); | |
2130 | theirtime = atol(parv[4]); | |
2131 | - deltat = abs(theirtime - CurrentTime); | |
2132 | + deltat = abs(theirtime - rb_current_time()); | |
2133 | ||
2134 | if(deltat > ConfigFileEntry.ts_max_delta) | |
2135 | { | |
2136 | @@ -90,13 +90,13 @@ | |
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); | |
2142 | ilog(L_SERVER, | |
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); | |
2151 | return 0; | |
2152 | } | |
2153 | @@ -106,7 +106,7 @@ | |
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); | |
2159 | } | |
2160 | ||
2161 | return 0; | |
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 | |
2165 | @@ -31,7 +31,6 @@ | |
2166 | */ | |
2167 | ||
2168 | #include "stdinc.h" | |
2169 | -#include "tools.h" | |
2170 | #include "send.h" | |
2171 | #include "channel.h" | |
2172 | #include "client.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 | |
2176 | @@ -30,7 +30,6 @@ | |
2177 | * $Id: m_testline.c 3303 2007-03-28 15:22:49Z jilles $ | |
2178 | */ | |
2179 | #include "stdinc.h" | |
2180 | -#include "tools.h" | |
2181 | #include "send.h" | |
2182 | #include "client.h" | |
2183 | #include "modules.h" | |
2184 | @@ -82,7 +81,7 @@ | |
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 | |
2192 | * --nenolod | |
2193 | @@ -133,7 +132,7 @@ | |
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); | |
2200 | ||
2201 | return 0; | |
2202 | @@ -169,7 +168,7 @@ | |
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); | |
2209 | return 0; | |
2210 | } | |
2211 | @@ -179,7 +178,7 @@ | |
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); | |
2218 | return 0; | |
2219 | } | |
2220 | @@ -191,7 +190,7 @@ | |
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); | |
2227 | ||
2228 | /* this is a false positive, so make sure it isn't counted in stats q | |
2229 | @@ -231,7 +230,7 @@ | |
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); | |
2236 | return 0; | |
2237 | } | |
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 | |
2241 | @@ -93,7 +93,7 @@ | |
2242 | time_t lclock; | |
2243 | int minswest; | |
2244 | ||
2245 | - lclock = CurrentTime; | |
2246 | + lclock = rb_current_time(); | |
2247 | gm = gmtime(&lclock); | |
2248 | memcpy((void *) &gmbuf, (void *) gm, sizeof(gmbuf)); | |
2249 | gm = &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 | |
2253 | @@ -25,7 +25,6 @@ | |
2254 | */ | |
2255 | ||
2256 | #include "stdinc.h" | |
2257 | -#include "tools.h" | |
2258 | #include "channel.h" | |
2259 | #include "client.h" | |
2260 | #include "hash.h" | |
2261 | @@ -104,7 +103,7 @@ | |
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()); | |
2267 | ||
2268 | sendto_server(client_p, chptr, CAP_TS6, NOCAPS, | |
2269 | ":%s TOPIC %s :%s", | |
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 | |
2273 | @@ -34,7 +34,6 @@ | |
2274 | #include "irc_string.h" | |
2275 | #include "ircd.h" | |
2276 | #include "numeric.h" | |
2277 | -#include "commio.h" | |
2278 | #include "s_serv.h" | |
2279 | #include "s_conf.h" | |
2280 | #include "s_newconf.h" | |
2281 | @@ -370,7 +369,7 @@ | |
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); | |
2287 | cnt++; | |
2288 | break; | |
2289 | ||
2290 | @@ -387,16 +386,16 @@ | |
2291 | form_str(RPL_TRACEOPERATOR), | |
2292 | class_name, name, | |
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); | |
2298 | ||
2299 | else | |
2300 | sendto_one_numeric(source_p, RPL_TRACEUSER, | |
2301 | form_str(RPL_TRACEUSER), | |
2302 | class_name, name, | |
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); | |
2308 | cnt++; | |
2309 | } | |
2310 | break; | |
2311 | @@ -411,7 +410,7 @@ | |
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); | |
2317 | cnt++; | |
2318 | ||
2319 | } | |
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 | |
2323 | @@ -73,8 +73,8 @@ | |
2324 | *p = '\0'; | |
2325 | ||
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); | |
2331 | ||
2332 | do_local_user(client_p, source_p, parv[1], parv[4]); | |
2333 | return 0; | |
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 | |
2337 | @@ -61,7 +61,7 @@ | |
2338 | ||
2339 | if(parc > 1) | |
2340 | { | |
2341 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
2342 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
2343 | { | |
2344 | /* safe enough to give this on a local connect only */ | |
2345 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
2346 | @@ -69,7 +69,7 @@ | |
2347 | return 0; | |
2348 | } | |
2349 | else | |
2350 | - last_used = CurrentTime; | |
2351 | + last_used = rb_current_time(); | |
2352 | ||
2353 | if(hunt_server(client_p, source_p, ":%s VERSION :%s", 1, parc, parv) != HUNTED_ISME) | |
2354 | return 0; | |
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 | |
2358 | @@ -24,7 +24,6 @@ | |
2359 | * $Id: m_who.c 3350 2007-04-02 22:03:08Z jilles $ | |
2360 | */ | |
2361 | #include "stdinc.h" | |
2362 | -#include "tools.h" | |
2363 | #include "common.h" | |
2364 | #include "client.h" | |
2365 | #include "channel.h" | |
2366 | @@ -177,7 +176,7 @@ | |
2367 | /* it has to be a global who at this point, limit it */ | |
2368 | if(!IsOper(source_p)) | |
2369 | { | |
2370 | - if((last_used + ConfigFileEntry.pace_wait) > CurrentTime) | |
2371 | + if((last_used + ConfigFileEntry.pace_wait) > rb_current_time()) | |
2372 | { | |
2373 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
2374 | me.name, source_p->name, "WHO"); | |
2375 | @@ -186,7 +185,7 @@ | |
2376 | return 0; | |
2377 | } | |
2378 | else | |
2379 | - last_used = CurrentTime; | |
2380 | + last_used = rb_current_time(); | |
2381 | } | |
2382 | ||
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 | |
2387 | @@ -25,7 +25,6 @@ | |
2388 | */ | |
2389 | ||
2390 | #include "stdinc.h" | |
2391 | -#include "tools.h" | |
2392 | #include "common.h" | |
2393 | #include "client.h" | |
2394 | #include "hash.h" | |
2395 | @@ -91,7 +90,7 @@ | |
2396 | if(!IsOper(source_p)) | |
2397 | { | |
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()) | |
2401 | { | |
2402 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
2403 | me.name, source_p->name, "WHOIS"); | |
2404 | @@ -100,7 +99,7 @@ | |
2405 | return 0; | |
2406 | } | |
2407 | else | |
2408 | - last_used = CurrentTime; | |
2409 | + last_used = rb_current_time(); | |
2410 | } | |
2411 | ||
2412 | if(hunt_server(client_p, source_p, ":%s WHOIS %s :%s", 1, parc, parv) != | |
2413 | @@ -346,7 +345,7 @@ | |
2414 | ||
2415 | sendto_one_numeric(source_p, RPL_WHOISIDLE, form_str(RPL_WHOISIDLE), | |
2416 | target_p->name, | |
2417 | - CurrentTime - target_p->localClient->last, | |
2418 | + rb_current_time() - target_p->localClient->last, | |
2419 | target_p->localClient->firsttime); | |
2420 | } | |
2421 | else | |
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 | |
2425 | @@ -69,7 +69,7 @@ | |
2426 | ||
2427 | if(!IsOper(source_p)) | |
2428 | { | |
2429 | - if((last_used + ConfigFileEntry.pace_wait_simple) > CurrentTime) | |
2430 | + if((last_used + ConfigFileEntry.pace_wait_simple) > rb_current_time()) | |
2431 | { | |
2432 | sendto_one(source_p, form_str(RPL_LOAD2HI), | |
2433 | me.name, source_p->name, "WHOWAS"); | |
2434 | @@ -78,7 +78,7 @@ | |
2435 | return 0; | |
2436 | } | |
2437 | else | |
2438 | - last_used = CurrentTime; | |
2439 | + last_used = rb_current_time(); | |
2440 | } | |
2441 | ||
2442 | ||
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 | |
2446 | @@ -31,7 +31,6 @@ | |
2447 | */ | |
2448 | ||
2449 | #include "stdinc.h" | |
2450 | -#include "tools.h" | |
2451 | #include "send.h" | |
2452 | #include "channel.h" | |
2453 | #include "client.h" | |
2454 | @@ -40,7 +39,6 @@ | |
2455 | #include "class.h" | |
2456 | #include "ircd.h" | |
2457 | #include "numeric.h" | |
2458 | -#include "memory.h" | |
2459 | #include "s_log.h" | |
2460 | #include "s_serv.h" | |
2461 | #include "whowas.h" | |
2462 | @@ -313,17 +311,17 @@ | |
2463 | } | |
2464 | ||
2465 | *new = '\0'; | |
2466 | - DupString(aconf->name, tmp); | |
2467 | + aconf->name = rb_strdup(tmp); | |
2468 | } | |
2469 | else | |
2470 | - DupString(aconf->name, name); | |
2471 | + aconf->name = rb_strdup(name); | |
2472 | ||
2473 | - DupString(aconf->passwd, reason); | |
2474 | + aconf->passwd = rb_strdup(reason); | |
2475 | collapse(aconf->name); | |
2476 | ||
2477 | if(temp_time > 0) | |
2478 | { | |
2479 | - aconf->hold = CurrentTime + temp_time; | |
2480 | + aconf->hold = rb_current_time() + temp_time; | |
2481 | ||
2482 | sendto_realops_snomask(SNO_GENERAL, L_ALL, | |
2483 | "%s added temporary %d min. X-Line for [%s] [%s]", | |
2484 | @@ -347,7 +345,7 @@ | |
2485 | get_oper_name(source_p), name, reason); | |
2486 | } | |
2487 | ||
2488 | - dlinkAddAlloc(aconf, &xline_conf_list); | |
2489 | + rb_dlinkAddAlloc(aconf, &xline_conf_list); | |
2490 | check_xlines(); | |
2491 | } | |
2492 | ||
2493 | @@ -375,7 +373,7 @@ | |
2494 | ||
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()); | |
2499 | ||
2500 | if(fputs(buffer, out) == -1) | |
2501 | { | |
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 | |
2505 | @@ -33,9 +33,9 @@ | |
2506 | SSL_LIBS = @SSL_LIBS@ | |
2507 | SSL_INCLUDES = @SSL_INCLUDES@ | |
2508 | ||
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) | |
2511 | ||
2512 | -INCLUDES = -I../include -I../libcharybdis -I../libratbox/include $(SSL_INCLUDES) | |
2513 | +INCLUDES = -I../include -I../libratbox/include $(SSL_INCLUDES) | |
2514 | CPPFLAGS = ${INCLUDES} @CPPFLAGS@ | |
2515 | ||
2516 | default: all | |
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 | |
2520 | @@ -36,8 +36,6 @@ | |
2521 | #include "stdinc.h" | |
2522 | #include "client.h" | |
2523 | #include "res.h" | |
2524 | -#include "tools.h" | |
2525 | -#include "memory.h" | |
2526 | #include "numeric.h" | |
2527 | #include "reject.h" | |
2528 | #include "s_conf.h" | |
2529 | @@ -74,7 +72,7 @@ | |
2530 | { | |
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)); | |
2533 | - MyFree(blcptr); | |
2534 | + rb_free(blcptr); | |
2535 | return; | |
2536 | } | |
2537 | ||
2538 | @@ -84,12 +82,12 @@ | |
2539 | if (reply->addr.ss_family == AF_INET && | |
2540 | !memcmp(&((struct sockaddr_in *)&reply->addr)->sin_addr, "\177\0\0", 3)) | |
2541 | listed = TRUE; | |
2542 | - else if (blcptr->blacklist->lastwarning + 3600 < CurrentTime) | |
2543 | + else if (blcptr->blacklist->lastwarning + 3600 < rb_current_time()) | |
2544 | { | |
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(); | |
2550 | } | |
2551 | } | |
2552 | ||
2553 | @@ -112,13 +110,13 @@ | |
2554 | register_local_user(blcptr->client_p, blcptr->client_p, buf); | |
2555 | } | |
2556 | ||
2557 | - MyFree(blcptr); | |
2558 | + rb_free(blcptr); | |
2559 | } | |
2560 | ||
2561 | /* XXX: no IPv6 implementation, not to concerned right now though. */ | |
2562 | static void initiate_blacklist_dnsquery(struct Blacklist *blptr, struct Client *client_p) | |
2563 | { | |
2564 | - struct BlacklistClient *blcptr = MyMalloc(sizeof(struct BlacklistClient)); | |
2565 | + struct BlacklistClient *blcptr = rb_malloc(sizeof(struct BlacklistClient)); | |
2566 | char buf[IRCD_BUFSIZE]; | |
2567 | int ip[4]; | |
2568 | ||
2569 | @@ -151,7 +149,7 @@ | |
2570 | blptr = find_blacklist(name); | |
2571 | if (blptr == NULL) | |
2572 | { | |
2573 | - blptr = MyMalloc(sizeof(struct Blacklist)); | |
2574 | + blptr = rb_malloc(sizeof(struct Blacklist)); | |
2575 | rb_dlinkAddAlloc(blptr, &blacklist_list); | |
2576 | } | |
2577 | else | |
2578 | @@ -169,7 +167,7 @@ | |
2579 | if (blptr->status & CONF_ILLEGAL && blptr->refcount <= 0) | |
2580 | { | |
2581 | rb_dlinkFindDestroy(blptr, &blacklist_list); | |
2582 | - MyFree(blptr); | |
2583 | + rb_free(blptr); | |
2584 | } | |
2585 | } | |
2586 | ||
2587 | @@ -203,7 +201,7 @@ | |
2588 | rb_dlinkDelete(&blcptr->node, &client_p->preClient->dnsbl_queries); | |
2589 | unref_blacklist(blcptr->blacklist); | |
2590 | delete_resolver_queries(&blcptr->dns_query); | |
2591 | - MyFree(blcptr); | |
2592 | + rb_free(blcptr); | |
2593 | } | |
2594 | } | |
2595 | ||
2596 | @@ -220,7 +218,7 @@ | |
2597 | blptr->status |= CONF_ILLEGAL; | |
2598 | else | |
2599 | { | |
2600 | - MyFree(ptr->data); | |
2601 | + rb_free(ptr->data); | |
2602 | rb_dlinkDestroy(ptr, &blacklist_list); | |
2603 | } | |
2604 | } | |
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 | |
2608 | @@ -36,11 +36,7 @@ | |
2609 | #include "ircd_defs.h" | |
2610 | #include "common.h" | |
2611 | #include "s_conf.h" | |
2612 | -#include "tools.h" | |
2613 | #include "client.h" | |
2614 | -#include "memory.h" | |
2615 | -#include "balloc.h" | |
2616 | -#include "event.h" | |
2617 | #include "hash.h" | |
2618 | #include "cache.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 | |
2623 | @@ -25,7 +25,6 @@ | |
2624 | */ | |
2625 | ||
2626 | #include "stdinc.h" | |
2627 | -#include "tools.h" | |
2628 | #include "channel.h" | |
2629 | #include "client.h" | |
2630 | #include "common.h" | |
2631 | @@ -41,9 +40,6 @@ | |
2632 | #include "whowas.h" | |
2633 | #include "s_conf.h" /* ConfigFileEntry, ConfigChannel */ | |
2634 | #include "s_newconf.h" | |
2635 | -#include "event.h" | |
2636 | -#include "memory.h" | |
2637 | -#include "balloc.h" | |
2638 | #include "s_log.h" | |
2639 | ||
2640 | extern rb_dlink_list global_channel_list; | |
2641 | @@ -93,14 +89,14 @@ | |
2642 | { | |
2643 | struct Channel *chptr; | |
2644 | chptr = BlockHeapAlloc(channel_heap); | |
2645 | - DupString(chptr->chname, chname); | |
2646 | + chptr->chname = rb_strdup(chname); | |
2647 | return (chptr); | |
2648 | } | |
2649 | ||
2650 | void | |
2651 | free_channel(struct Channel *chptr) | |
2652 | { | |
2653 | - MyFree(chptr->chname); | |
2654 | + rb_free(chptr->chname); | |
2655 | BlockHeapFree(channel_heap, chptr); | |
2656 | } | |
2657 | ||
2658 | @@ -109,8 +105,8 @@ | |
2659 | { | |
2660 | struct Ban *bptr; | |
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); | |
2666 | ||
2667 | return (bptr); | |
2668 | } | |
2669 | @@ -118,8 +114,8 @@ | |
2670 | void | |
2671 | free_ban(struct Ban *bptr) | |
2672 | { | |
2673 | - MyFree(bptr->banstr); | |
2674 | - MyFree(bptr->who); | |
2675 | + rb_free(bptr->banstr); | |
2676 | + rb_free(bptr->who); | |
2677 | BlockHeapFree(ban_heap, bptr); | |
2678 | } | |
2679 | ||
2680 | @@ -246,7 +242,7 @@ | |
2681 | if(client_p->servptr == &me) | |
2682 | rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers); | |
2683 | ||
2684 | - chptr->users_last = CurrentTime; | |
2685 | + chptr->users_last = rb_current_time(); | |
2686 | ||
2687 | if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0) | |
2688 | destroy_channel(chptr); | |
2689 | @@ -283,7 +279,7 @@ | |
2690 | if(client_p->servptr == &me) | |
2691 | rb_dlinkDelete(&msptr->locchannode, &chptr->locmembers); | |
2692 | ||
2693 | - chptr->users_last = CurrentTime; | |
2694 | + chptr->users_last = rb_current_time(); | |
2695 | ||
2696 | if(!(chptr->mode.mode & MODE_PERMANENT) && rb_dlink_list_length(&chptr->members) <= 0) | |
2697 | destroy_channel(chptr); | |
2698 | @@ -788,7 +784,7 @@ | |
2699 | /* join throttling stuff --nenolod */ | |
2700 | else if(chptr->mode.join_num > 0 && chptr->mode.join_time > 0) | |
2701 | { | |
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)) | |
2706 | i = ERR_THROTTLE; | |
2707 | @@ -946,7 +942,7 @@ | |
2708 | else | |
2709 | { | |
2710 | if((t_delta = | |
2711 | - (CurrentTime - source_p->localClient->last_leave_time)) > | |
2712 | + (rb_current_time() - source_p->localClient->last_leave_time)) > | |
2713 | JOIN_LEAVE_COUNT_EXPIRE_TIME) | |
2714 | { | |
2715 | decrement_count = (t_delta / JOIN_LEAVE_COUNT_EXPIRE_TIME); | |
2716 | @@ -957,7 +953,7 @@ | |
2717 | } | |
2718 | else | |
2719 | { | |
2720 | - if((CurrentTime - | |
2721 | + if((rb_current_time() - | |
2722 | (source_p->localClient->last_join_time)) < GlobalSetOptions.spam_time) | |
2723 | { | |
2724 | /* oh, its a possible spambot */ | |
2725 | @@ -965,9 +961,9 @@ | |
2726 | } | |
2727 | } | |
2728 | if(name != NULL) | |
2729 | - source_p->localClient->last_join_time = CurrentTime; | |
2730 | + source_p->localClient->last_join_time = rb_current_time(); | |
2731 | else | |
2732 | - source_p->localClient->last_leave_time = CurrentTime; | |
2733 | + source_p->localClient->last_leave_time = rb_current_time(); | |
2734 | } | |
2735 | } | |
2736 | ||
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 | |
2740 | @@ -26,7 +26,6 @@ | |
2741 | */ | |
2742 | ||
2743 | #include "stdinc.h" | |
2744 | -#include "tools.h" | |
2745 | #include "channel.h" | |
2746 | #include "client.h" | |
2747 | #include "common.h" | |
2748 | @@ -42,9 +41,6 @@ | |
2749 | #include "whowas.h" | |
2750 | #include "s_conf.h" /* ConfigFileEntry, ConfigChannel */ | |
2751 | #include "s_newconf.h" | |
2752 | -#include "event.h" | |
2753 | -#include "memory.h" | |
2754 | -#include "balloc.h" | |
2755 | #include "s_log.h" | |
2756 | ||
2757 | /* bitmasks for error returns, so we send once per call */ | |
2758 | @@ -133,7 +129,7 @@ | |
2759 | strlcpy(who, source_p->name, sizeof(who)); | |
2760 | ||
2761 | actualBan = allocate_ban(realban, who); | |
2762 | - actualBan->when = CurrentTime; | |
2763 | + actualBan->when = rb_current_time(); | |
2764 | ||
2765 | rb_dlinkAdd(actualBan, &actualBan->node, list); | |
2766 | ||
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 | |
2770 | @@ -27,7 +27,6 @@ | |
2771 | #include "stdinc.h" | |
2772 | #include "config.h" | |
2773 | ||
2774 | -#include "tools.h" | |
2775 | #include "class.h" | |
2776 | #include "client.h" | |
2777 | #include "common.h" | |
2778 | @@ -37,7 +36,6 @@ | |
2779 | #include "s_newconf.h" | |
2780 | #include "send.h" | |
2781 | #include "irc_string.h" | |
2782 | -#include "memory.h" | |
2783 | ||
2784 | #define BAD_CONF_CLASS -1 | |
2785 | #define BAD_PING -2 | |
2786 | @@ -51,7 +49,7 @@ | |
2787 | { | |
2788 | struct Class *tmp; | |
2789 | ||
2790 | - tmp = (struct Class *) MyMalloc(sizeof(struct Class)); | |
2791 | + tmp = (struct Class *) rb_malloc(sizeof(struct Class)); | |
2792 | ||
2793 | ConFreq(tmp) = DEFAULT_CONNECTFREQUENCY; | |
2794 | PingFreq(tmp) = DEFAULT_PINGFREQUENCY; | |
2795 | @@ -68,8 +66,8 @@ | |
2796 | if(tmp->ip_limits) | |
2797 | rb_destroy_patricia(tmp->ip_limits, NULL); | |
2798 | ||
2799 | - MyFree(tmp->class_name); | |
2800 | - MyFree(tmp); | |
2801 | + rb_free(tmp->class_name); | |
2802 | + rb_free(tmp); | |
2803 | ||
2804 | } | |
2805 | ||
2806 | @@ -274,7 +272,7 @@ | |
2807 | initclass() | |
2808 | { | |
2809 | default_class = make_class(); | |
2810 | - DupString(ClassName(default_class), "default"); | |
2811 | + ClassName(default_class) = rb_strdup("default"); | |
2812 | } | |
2813 | ||
2814 | /* | |
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 | |
2818 | @@ -27,11 +27,9 @@ | |
2819 | #include "stdinc.h" | |
2820 | #include "config.h" | |
2821 | ||
2822 | -#include "tools.h" | |
2823 | #include "client.h" | |
2824 | #include "class.h" | |
2825 | #include "common.h" | |
2826 | -#include "event.h" | |
2827 | #include "hash.h" | |
2828 | #include "irc_string.h" | |
2829 | #include "sprintf_irc.h" | |
2830 | @@ -40,7 +38,6 @@ | |
2831 | #include "numeric.h" | |
2832 | #include "packet.h" | |
2833 | #include "s_auth.h" | |
2834 | -#include "commio.h" | |
2835 | #include "s_conf.h" | |
2836 | #include "s_newconf.h" | |
2837 | #include "s_log.h" | |
2838 | @@ -49,11 +46,8 @@ | |
2839 | #include "send.h" | |
2840 | #include "whowas.h" | |
2841 | #include "s_user.h" | |
2842 | -#include "linebuf.h" | |
2843 | #include "hash.h" | |
2844 | -#include "memory.h" | |
2845 | #include "hostmask.h" | |
2846 | -#include "balloc.h" | |
2847 | #include "listener.h" | |
2848 | #include "hook.h" | |
2849 | #include "msg.h" | |
2850 | @@ -160,7 +154,7 @@ | |
2851 | SetMyConnect(client_p); | |
2852 | client_p->localClient = localClient; | |
2853 | ||
2854 | - client_p->localClient->lasttime = client_p->localClient->firsttime = CurrentTime; | |
2855 | + client_p->localClient->lasttime = client_p->localClient->firsttime = rb_current_time(); | |
2856 | ||
2857 | client_p->localClient->F = NULL; | |
2858 | client_p->localClient->ctrlfd = -1; | |
2859 | @@ -229,13 +223,13 @@ | |
2860 | { | |
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); | |
2865 | } | |
2866 | ||
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); | |
2875 | ||
2876 | BlockHeapFree(lclient_heap, client_p->localClient); | |
2877 | client_p->localClient = NULL; | |
2878 | @@ -309,13 +303,13 @@ | |
2879 | ||
2880 | ping = get_client_ping(client_p); | |
2881 | ||
2882 | - if(ping < (CurrentTime - client_p->localClient->lasttime)) | |
2883 | + if(ping < (rb_current_time() - client_p->localClient->lasttime)) | |
2884 | { | |
2885 | /* | |
2886 | * If the client/server hasnt talked to us in 2*ping seconds | |
2887 | * and it has a ping time, then close its connection. | |
2888 | */ | |
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))) | |
2892 | { | |
2893 | if(IsServer(client_p)) | |
2894 | @@ -329,7 +323,7 @@ | |
2895 | } | |
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)); | |
2900 | ||
2901 | exit_client(client_p, client_p, &me, scratch); | |
2902 | continue; | |
2903 | @@ -343,7 +337,7 @@ | |
2904 | */ | |
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); | |
2910 | } | |
2911 | } | |
2912 | @@ -379,7 +373,7 @@ | |
2913 | */ | |
2914 | ||
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) | |
2918 | { | |
2919 | if(IsAnyServer(client_p)) | |
2920 | { | |
2921 | @@ -797,8 +791,8 @@ | |
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); | |
2929 | } | |
2930 | } | |
2931 | ||
2932 | @@ -1289,7 +1283,7 @@ | |
2933 | */ | |
2934 | abt->client->flags &= ~FLAGS_CLOSING; | |
2935 | exit_client(abt->client, abt->client, &me, abt->notice); | |
2936 | - MyFree(abt); | |
2937 | + rb_free(abt); | |
2938 | } | |
2939 | } | |
2940 | ||
2941 | @@ -1307,7 +1301,7 @@ | |
2942 | if(IsDead(client_p) || IsClosing(client_p) || IsMe(client_p)) | |
2943 | return; | |
2944 | ||
2945 | - abt = (struct abort_client *) MyMalloc(sizeof(struct abort_client)); | |
2946 | + abt = (struct abort_client *) rb_malloc(sizeof(struct abort_client)); | |
2947 | ||
2948 | if(client_p->flags & FLAGS_SENDQEX) | |
2949 | strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice)); | |
2950 | @@ -1559,10 +1553,10 @@ | |
2951 | ||
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); | |
2956 | ||
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); | |
2960 | ||
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", | |
2965 | comment); | |
2966 | ||
2967 | - on_for = CurrentTime - source_p->localClient->firsttime; | |
2968 | + on_for = rb_current_time() - source_p->localClient->firsttime; | |
2969 | ||
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 @@ | |
2977 | ||
2978 | if(!serv) | |
2979 | { | |
2980 | - serv = (server_t *) MyMalloc(sizeof(server_t)); | |
2981 | + serv = (server_t *) rb_malloc(sizeof(server_t)); | |
2982 | client_p->serv = serv; | |
2983 | } | |
2984 | return client_p->serv; | |
2985 | @@ -1915,7 +1909,7 @@ | |
2986 | if(--user->refcnt <= 0) | |
2987 | { | |
2988 | if(user->away) | |
2989 | - MyFree((char *) user->away); | |
2990 | + rb_free((char *) user->away); | |
2991 | /* | |
2992 | * sanity check | |
2993 | */ | |
2994 | @@ -1940,6 +1934,23 @@ | |
2995 | ||
2996 | BlockHeapFree(user_heap, user); | |
2997 | } | |
2998 | +} | |
2999 | + | |
3000 | +void\r | |
3001 | +allocate_away(struct Client *client_p)\r | |
3002 | +{\r | |
3003 | + if(client_p->user->away == NULL)\r | |
3004 | + client_p->user->away = rb_bh_alloc(away_heap); \r | |
3005 | +}\r | |
3006 | +\r | |
3007 | +\r | |
3008 | +void\r | |
3009 | +free_away(struct Client *client_p)\r | |
3010 | +{\r | |
3011 | + if(client_p->user->away != NULL) {\r | |
3012 | + rb_bh_free(away_heap, client_p->user->away);\r | |
3013 | + client_p->user->away = NULL;\r | |
3014 | + }\r | |
3015 | } | |
3016 | ||
3017 | void | |
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) | |
3025 | { | |
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) | |
3034 | { | |
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 | |
3039 | @@ -23,7 +23,6 @@ | |
3040 | */ | |
3041 | ||
3042 | #include "stdinc.h" | |
3043 | -#include "tools.h" | |
3044 | #include "channel.h" | |
3045 | #include "client.h" | |
3046 | #include "common.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 | |
3050 | @@ -26,7 +26,6 @@ | |
3051 | ||
3052 | #include "stdinc.h" | |
3053 | #include "ircd_defs.h" | |
3054 | -#include "tools.h" | |
3055 | #include "s_conf.h" | |
3056 | #include "channel.h" | |
3057 | #include "client.h" | |
3058 | @@ -36,7 +35,6 @@ | |
3059 | #include "ircd.h" | |
3060 | #include "numeric.h" | |
3061 | #include "send.h" | |
3062 | -#include "memory.h" | |
3063 | #include "msg.h" | |
3064 | #include "cache.h" | |
3065 | #include "s_newconf.h" | |
3066 | @@ -91,11 +89,11 @@ | |
3067 | void | |
3068 | init_hash(void) | |
3069 | { | |
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); | |
3080 | } | |
3081 | ||
3082 | #ifndef RICER_HASHING | |
3083 | @@ -602,7 +600,7 @@ | |
3084 | ||
3085 | rb_dlinkAdd(chptr, &chptr->node, &global_channel_list); | |
3086 | ||
3087 | - chptr->channelts = CurrentTime; /* doesn't hurt to set it here */ | |
3088 | + chptr->channelts = rb_current_time(); /* doesn't hurt to set it here */ | |
3089 | ||
3090 | rb_dlinkAddAlloc(chptr, &channelTable[hashv]); | |
3091 | ||
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 | |
3095 | @@ -37,8 +37,6 @@ | |
3096 | * $Id: hook.c 712 2006-02-06 04:42:14Z gxti $ | |
3097 | */ | |
3098 | #include "stdinc.h" | |
3099 | -#include "memory.h" | |
3100 | -#include "tools.h" | |
3101 | #include "hook.h" | |
3102 | #include "irc_string.h" | |
3103 | ||
3104 | @@ -68,7 +66,7 @@ | |
3105 | void | |
3106 | init_hook(void) | |
3107 | { | |
3108 | - hooks = MyMalloc(sizeof(hook) * HOOK_INCREMENT); | |
3109 | + hooks = rb_malloc(sizeof(hook) * HOOK_INCREMENT); | |
3110 | ||
3111 | #ifdef USE_IODEBUG_HOOKS | |
3112 | h_iosend_id = register_hook("iosend"); | |
3113 | @@ -96,10 +94,10 @@ | |
3114 | { | |
3115 | hook *newhooks; | |
3116 | ||
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); | |
3120 | ||
3121 | - MyFree(hooks); | |
3122 | + rb_free(hooks); | |
3123 | hooks = newhooks; | |
3124 | max_hooks += HOOK_INCREMENT; | |
3125 | } | |
3126 | @@ -158,7 +156,7 @@ | |
3127 | if((i = find_hook(name)) < 0) | |
3128 | { | |
3129 | i = find_freehookslot(); | |
3130 | - DupString(hooks[i].name, name); | |
3131 | + hooks[i].name = rb_strdup(name); | |
3132 | num_hooks++; | |
3133 | } | |
3134 | ||
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 | |
3138 | @@ -26,7 +26,6 @@ | |
3139 | */ | |
3140 | ||
3141 | #include "stdinc.h" | |
3142 | -#include "memory.h" | |
3143 | #include "ircd_defs.h" | |
3144 | #include "s_conf.h" | |
3145 | #include "hostmask.h" | |
3146 | @@ -447,7 +446,7 @@ | |
3147 | ||
3148 | if(address == NULL) | |
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); | |
3153 | #ifdef IPV6 | |
3154 | if(masktype == HM_IPV6) | |
3155 | @@ -504,7 +503,7 @@ | |
3156 | ||
3157 | if(address == NULL) | |
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; | |
3164 | @@ -579,7 +578,7 @@ | |
3165 | aconf->status |= CONF_ILLEGAL; | |
3166 | if(!aconf->clients) | |
3167 | free_conf(aconf); | |
3168 | - MyFree(arec); | |
3169 | + rb_free(arec); | |
3170 | return; | |
3171 | } | |
3172 | arecl = arec; | |
3173 | @@ -619,7 +618,7 @@ | |
3174 | arec->aconf->status |= CONF_ILLEGAL; | |
3175 | if(!arec->aconf->clients) | |
3176 | free_conf(arec->aconf); | |
3177 | - MyFree(arec); | |
3178 | + rb_free(arec); | |
3179 | } | |
3180 | } | |
3181 | *store_next = NULL; | |
3182 | @@ -652,7 +651,7 @@ | |
3183 | arec->aconf->status |= CONF_ILLEGAL; | |
3184 | if(!arec->aconf->clients) | |
3185 | free_conf(arec->aconf); | |
3186 | - MyFree(arec); | |
3187 | + rb_free(arec); | |
3188 | } | |
3189 | } | |
3190 | *store_next = NULL; | |
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 | |
3194 | @@ -24,12 +24,9 @@ | |
3195 | ||
3196 | #include "stdinc.h" | |
3197 | #include "sprintf_irc.h" | |
3198 | -#include "tools.h" | |
3199 | #include "irc_string.h" | |
3200 | #include "client.h" | |
3201 | -#include "memory.h" | |
3202 | #include "setup.h" | |
3203 | -#include "balloc.h" | |
3204 | #include "irc_dictionary.h" | |
3205 | ||
3206 | static BlockHeap *elem_heap = NULL; | |
3207 | @@ -60,7 +57,7 @@ | |
3208 | */ | |
3209 | struct Dictionary *irc_dictionary_create(DCF compare_cb) | |
3210 | { | |
3211 | - struct Dictionary *dtree = (struct Dictionary *) MyMalloc(sizeof(struct Dictionary)); | |
3212 | + struct Dictionary *dtree = (struct Dictionary *) rb_malloc(sizeof(struct Dictionary)); | |
3213 | ||
3214 | dtree->compare_cb = compare_cb; | |
3215 | ||
3216 | @@ -90,10 +87,10 @@ | |
3217 | struct Dictionary *irc_dictionary_create_named(const char *name, | |
3218 | DCF compare_cb) | |
3219 | { | |
3220 | - struct Dictionary *dtree = (struct Dictionary *) MyMalloc(sizeof(struct Dictionary)); | |
3221 | + struct Dictionary *dtree = (struct Dictionary *) rb_malloc(sizeof(struct Dictionary)); | |
3222 | ||
3223 | dtree->compare_cb = compare_cb; | |
3224 | - DupString(dtree->id, name); | |
3225 | + dtree->id = rb_strdup(name); | |
3226 | ||
3227 | if (!elem_heap) | |
3228 | elem_heap = BlockHeapCreate(sizeof(struct DictionaryElement), 1024); | |
3229 | @@ -479,7 +476,7 @@ | |
3230 | BlockHeapFree(elem_heap, n); | |
3231 | } | |
3232 | ||
3233 | - MyFree(dtree); | |
3234 | + rb_free(dtree); | |
3235 | } | |
3236 | ||
3237 | /* | |
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 | |
3241 | @@ -26,10 +26,8 @@ | |
3242 | ||
3243 | #include "stdinc.h" | |
3244 | #include "sprintf_irc.h" | |
3245 | -#include "tools.h" | |
3246 | #include "irc_string.h" | |
3247 | #include "client.h" | |
3248 | -#include "memory.h" | |
3249 | #include "setup.h" | |
3250 | ||
3251 | #ifndef INADDRSZ | |
3252 | @@ -220,7 +218,7 @@ | |
3253 | return NULL; | |
3254 | } | |
3255 | ||
3256 | - result = MyMalloc(((length + 2) / 3) * 5); | |
3257 | + result = rb_malloc(((length + 2) / 3) * 5); | |
3258 | p = result; | |
3259 | ||
3260 | while (length > 2) | |
3261 | @@ -257,7 +255,7 @@ | |
3262 | int ch, i = 0, j = 0, k; | |
3263 | unsigned char *result; | |
3264 | ||
3265 | - result = MyMalloc(length + 1); | |
3266 | + result = rb_malloc(length + 1); | |
3267 | ||
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 | |
3273 | @@ -28,13 +28,11 @@ | |
3274 | #include "setup.h" | |
3275 | #include "config.h" | |
3276 | ||
3277 | -#include "tools.h" | |
3278 | #include "ircd.h" | |
3279 | #include "channel.h" | |
3280 | #include "class.h" | |
3281 | #include "client.h" | |
3282 | #include "common.h" | |
3283 | -#include "event.h" | |
3284 | #include "hash.h" | |
3285 | #include "irc_string.h" | |
3286 | #include "ircd_signal.h" | |
3287 | @@ -47,7 +45,6 @@ | |
3288 | #include "res.h" | |
3289 | #include "restart.h" | |
3290 | #include "s_auth.h" | |
3291 | -#include "commio.h" | |
3292 | #include "s_conf.h" | |
3293 | #include "s_log.h" | |
3294 | #include "s_serv.h" /* try_connections */ | |
3295 | @@ -58,17 +55,14 @@ | |
3296 | #include "supported.h" | |
3297 | #include "whowas.h" | |
3298 | #include "modules.h" | |
3299 | -#include "memory.h" | |
3300 | #include "hook.h" | |
3301 | #include "ircd_getopt.h" | |
3302 | -#include "balloc.h" | |
3303 | #include "newconf.h" | |
3304 | #include "reject.h" | |
3305 | #include "s_conf.h" | |
3306 | #include "s_newconf.h" | |
3307 | #include "cache.h" | |
3308 | #include "monitor.h" | |
3309 | -#include "libcharybdis.h" | |
3310 | #include "patchlevel.h" | |
3311 | #include "serno.h" | |
3312 | ||
3313 | @@ -250,8 +244,8 @@ | |
3314 | newtime.tv_sec = time(NULL); | |
3315 | ||
3316 | #endif | |
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); | |
3321 | ||
3322 | SystemTime.tv_sec = newtime.tv_sec; | |
3323 | SystemTime.tv_usec = newtime.tv_usec; | |
3324 | @@ -297,7 +291,7 @@ | |
3325 | */ | |
3326 | ||
3327 | delay = rb_event_next(); | |
3328 | - if(delay <= CurrentTime) | |
3329 | + if(delay <= rb_current_time()) | |
3330 | rb_event_run(); | |
3331 | ||
3332 | ||
3333 | @@ -640,7 +634,7 @@ | |
3334 | me.servptr = &me; | |
3335 | SetMe(&me); | |
3336 | make_server(&me); | |
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 | |
3345 | @@ -105,7 +105,7 @@ | |
3346 | { | |
3347 | case CF_STRING: | |
3348 | case CF_QSTRING: | |
3349 | - MyFree(list->v.string); | |
3350 | + rb_free(list->v.string); | |
3351 | break; | |
3352 | case CF_LIST: | |
3353 | free_cur_list(list->v.list); | |
3354 | @@ -124,7 +124,7 @@ | |
3355 | { | |
3356 | if (cur_list == NULL) | |
3357 | { | |
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; | |
3362 | } | |
3363 | @@ -139,7 +139,7 @@ | |
3364 | { | |
3365 | conf_parm_t *new; | |
3366 | ||
3367 | - new = MyMalloc(sizeof(conf_parm_t)); | |
3368 | + new = rb_malloc(sizeof(conf_parm_t)); | |
3369 | new->next = NULL; | |
3370 | new->type = type; | |
3371 | ||
3372 | @@ -152,7 +152,7 @@ | |
3373 | break; | |
3374 | case CF_STRING: | |
3375 | case CF_QSTRING: | |
3376 | - DupString(new->v.string, str); | |
3377 | + new->v.string = rb_strdup(str); | |
3378 | break; | |
3379 | } | |
3380 | ||
3381 | @@ -253,19 +253,19 @@ | |
3382 | ||
3383 | oneitem: qstring | |
3384 | { | |
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); | |
3390 | } | |
3391 | | timespec | |
3392 | { | |
3393 | - $$ = MyMalloc(sizeof(conf_parm_t)); | |
3394 | + $$ = rb_malloc(sizeof(conf_parm_t)); | |
3395 | $$->type = CF_TIME; | |
3396 | $$->v.number = $1; | |
3397 | } | |
3398 | | number | |
3399 | { | |
3400 | - $$ = MyMalloc(sizeof(conf_parm_t)); | |
3401 | + $$ = rb_malloc(sizeof(conf_parm_t)); | |
3402 | $$->type = CF_INT; | |
3403 | $$->v.number = $1; | |
3404 | } | |
3405 | @@ -275,7 +275,7 @@ | |
3406 | so pass it as that, if so */ | |
3407 | int val = conf_get_yesno_value($1); | |
3408 | ||
3409 | - $$ = MyMalloc(sizeof(conf_parm_t)); | |
3410 | + $$ = rb_malloc(sizeof(conf_parm_t)); | |
3411 | ||
3412 | if (val != -1) | |
3413 | { | |
3414 | @@ -285,7 +285,7 @@ | |
3415 | else | |
3416 | { | |
3417 | $$->type = CF_STRING; | |
3418 | - DupString($$->v.string, $1); | |
3419 | + $$->v.string = rb_strdup($1); | |
3420 | } | |
3421 | } | |
3422 | ; | |
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 | |
3426 | @@ -25,8 +25,6 @@ | |
3427 | #include "ircd.h" /* dorehash */ | |
3428 | #include "restart.h" /* server_reboot */ | |
3429 | #include "s_log.h" | |
3430 | -#include "memory.h" | |
3431 | -#include "commio.h" | |
3432 | #include "s_conf.h" | |
3433 | #include "client.h" | |
3434 | #include "send.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 | |
3438 | @@ -38,14 +38,11 @@ | |
3439 | #include "config.h" | |
3440 | ||
3441 | #include "client.h" | |
3442 | -#include "tools.h" | |
3443 | -#include "tools.h" | |
3444 | #include "ircd.h" | |
3445 | #include "channel.h" | |
3446 | #include "class.h" | |
3447 | #include "client.h" | |
3448 | #include "common.h" | |
3449 | -#include "event.h" | |
3450 | #include "hash.h" | |
3451 | #include "irc_string.h" | |
3452 | #include "ircd_signal.h" | |
3453 | @@ -58,7 +55,6 @@ | |
3454 | #include "res.h" | |
3455 | #include "restart.h" | |
3456 | #include "s_auth.h" | |
3457 | -#include "commio.h" | |
3458 | #include "s_conf.h" | |
3459 | #include "s_log.h" | |
3460 | #include "s_serv.h" /* try_connections */ | |
3461 | @@ -68,10 +64,8 @@ | |
3462 | #include "send.h" | |
3463 | #include "whowas.h" | |
3464 | #include "modules.h" | |
3465 | -#include "memory.h" | |
3466 | #include "hook.h" | |
3467 | #include "ircd_getopt.h" | |
3468 | -#include "balloc.h" | |
3469 | #include "newconf.h" | |
3470 | #include "patricia.h" | |
3471 | #include "reject.h" | |
3472 | @@ -79,7 +73,6 @@ | |
3473 | #include "s_newconf.h" | |
3474 | #include "cache.h" | |
3475 | #include "monitor.h" | |
3476 | -#include "libcharybdis.h" | |
3477 | #include "patchlevel.h" | |
3478 | #include "serno.h" | |
3479 | ||
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 | |
3483 | @@ -25,14 +25,12 @@ | |
3484 | */ | |
3485 | ||
3486 | #include "stdinc.h" | |
3487 | -#include "tools.h" | |
3488 | #include "s_log.h" | |
3489 | #include "s_conf.h" | |
3490 | #include "s_newconf.h" | |
3491 | #include "hostmask.h" | |
3492 | #include "client.h" | |
3493 | #include "irc_string.h" | |
3494 | -#include "memory.h" | |
3495 | #include "hash.h" | |
3496 | ||
3497 | /* conf_add_fields() | |
3498 | @@ -47,21 +45,21 @@ | |
3499 | const char *operreason_field, const char *date_field) | |
3500 | { | |
3501 | if(host_field != NULL) | |
3502 | - DupString(aconf->host, host_field); | |
3503 | + aconf->host = rb_strdup(host_field); | |
3504 | if(pass_field != NULL) | |
3505 | { | |
3506 | if(!EmptyString(date_field)) | |
3507 | { | |
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); | |
3511 | } | |
3512 | else | |
3513 | - DupString(aconf->passwd, pass_field); | |
3514 | + aconf->passwd = rb_strdup(pass_field); | |
3515 | } | |
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); | |
3522 | } | |
3523 | ||
3524 | /* | |
3525 | @@ -196,8 +194,8 @@ | |
3526 | aconf = make_conf(); | |
3527 | aconf->status = CONF_XLINE; | |
3528 | ||
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); | |
3533 | ||
3534 | rb_dlinkAddAlloc(aconf, &xline_conf_list); | |
3535 | } | |
3536 | @@ -237,8 +235,8 @@ | |
3537 | aconf->status = CONF_RESV_CHANNEL; | |
3538 | aconf->port = 0; | |
3539 | ||
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); | |
3545 | } | |
3546 | else if(clean_resv_nick(host_field)) | |
3547 | @@ -250,8 +248,8 @@ | |
3548 | aconf->status = CONF_RESV_NICK; | |
3549 | aconf->port = 0; | |
3550 | ||
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); | |
3556 | } | |
3557 | } | |
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 | |
3561 | @@ -33,12 +33,10 @@ | |
3562 | #include "ircd.h" | |
3563 | #include "ircd_defs.h" | |
3564 | #include "numeric.h" | |
3565 | -#include "commio.h" | |
3566 | #include "s_conf.h" | |
3567 | #include "s_newconf.h" | |
3568 | #include "s_stats.h" | |
3569 | #include "send.h" | |
3570 | -#include "memory.h" | |
3571 | #include "s_auth.h" | |
3572 | #include "reject.h" | |
3573 | #include "s_conf.h" | |
3574 | @@ -60,7 +58,7 @@ | |
3575 | static listener_t * | |
3576 | make_listener(struct irc_sockaddr_storage *addr) | |
3577 | { | |
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); | |
3581 | ||
3582 | listener->name = me.name; | |
3583 | @@ -95,7 +93,7 @@ | |
3584 | } | |
3585 | ||
3586 | /* free */ | |
3587 | - MyFree(listener); | |
3588 | + rb_free(listener); | |
3589 | } | |
3590 | ||
3591 | #define PORTNAMELEN 6 /* ":31337" */ | |
3592 | @@ -530,12 +528,12 @@ | |
3593 | /* | |
3594 | * slow down the whining to opers bit | |
3595 | */ | |
3596 | - if((last_oper_notice + 20) <= CurrentTime) | |
3597 | + if((last_oper_notice + 20) <= rb_current_time()) | |
3598 | { | |
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(); | |
3604 | } | |
3605 | ||
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 | |
3610 | @@ -38,8 +38,6 @@ | |
3611 | #include "parse.h" | |
3612 | #include "ircd_defs.h" | |
3613 | #include "irc_string.h" | |
3614 | -#include "memory.h" | |
3615 | -#include "tools.h" | |
3616 | #include "sprintf_irc.h" | |
3617 | ||
3618 | ||
3619 | @@ -166,7 +164,7 @@ | |
3620 | if(mod_find_path(path)) | |
3621 | return; | |
3622 | ||
3623 | - pathst = MyMalloc(sizeof(struct module_path)); | |
3624 | + pathst = rb_malloc(sizeof(struct module_path)); | |
3625 | ||
3626 | strcpy(pathst->path, path); | |
3627 | rb_dlinkAddAlloc(pathst, &mod_paths); | |
3628 | @@ -185,7 +183,7 @@ | |
3629 | ||
3630 | RB_DLINK_FOREACH_SAFE(ptr, next_ptr, mod_paths.head) | |
3631 | { | |
3632 | - MyFree(ptr->data); | |
3633 | + rb_free(ptr->data); | |
3634 | free_rb_dlink_node(ptr); | |
3635 | } | |
3636 | ||
3637 | @@ -202,7 +200,7 @@ | |
3638 | char * | |
3639 | irc_basename(const char *path) | |
3640 | { | |
3641 | - char *mod_basename = MyMalloc(strlen(path) + 1); | |
3642 | + char *mod_basename = rb_malloc(strlen(path) + 1); | |
3643 | const char *s; | |
3644 | ||
3645 | if(!(s = strrchr(path, '/'))) | |
3646 | @@ -250,7 +248,7 @@ | |
3647 | ||
3648 | modules_init(); | |
3649 | ||
3650 | - modlist = (struct module **) MyMalloc(sizeof(struct module) * (MODS_INCREMENT)); | |
3651 | + modlist = (struct module **) rb_malloc(sizeof(struct module) * (MODS_INCREMENT)); | |
3652 | ||
3653 | max_mods = MODS_INCREMENT; | |
3654 | ||
3655 | @@ -366,13 +364,13 @@ | |
3656 | if(findmodule_byname(m_bn) != -1) | |
3657 | { | |
3658 | sendto_one_notice(source_p, ":Module %s is already loaded", m_bn); | |
3659 | - MyFree(m_bn); | |
3660 | + rb_free(m_bn); | |
3661 | return 0; | |
3662 | } | |
3663 | ||
3664 | load_one_module(parv[1], 0); | |
3665 | ||
3666 | - MyFree(m_bn); | |
3667 | + rb_free(m_bn); | |
3668 | ||
3669 | return 0; | |
3670 | } | |
3671 | @@ -397,14 +395,14 @@ | |
3672 | if((modindex = findmodule_byname(m_bn)) == -1) | |
3673 | { | |
3674 | sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); | |
3675 | - MyFree(m_bn); | |
3676 | + rb_free(m_bn); | |
3677 | return 0; | |
3678 | } | |
3679 | ||
3680 | if(modlist[modindex]->core == 1) | |
3681 | { | |
3682 | sendto_one_notice(source_p, ":Module %s is a core module and may not be unloaded", m_bn); | |
3683 | - MyFree(m_bn); | |
3684 | + rb_free(m_bn); | |
3685 | return 0; | |
3686 | } | |
3687 | ||
3688 | @@ -413,7 +411,7 @@ | |
3689 | sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); | |
3690 | } | |
3691 | ||
3692 | - MyFree(m_bn); | |
3693 | + rb_free(m_bn); | |
3694 | return 0; | |
3695 | } | |
3696 | ||
3697 | @@ -437,7 +435,7 @@ | |
3698 | if((modindex = findmodule_byname(m_bn)) == -1) | |
3699 | { | |
3700 | sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); | |
3701 | - MyFree(m_bn); | |
3702 | + rb_free(m_bn); | |
3703 | return 0; | |
3704 | } | |
3705 | ||
3706 | @@ -446,7 +444,7 @@ | |
3707 | if(unload_one_module(m_bn, 1) == -1) | |
3708 | { | |
3709 | sendto_one_notice(source_p, ":Module %s is not loaded", m_bn); | |
3710 | - MyFree(m_bn); | |
3711 | + rb_free(m_bn); | |
3712 | return 0; | |
3713 | } | |
3714 | ||
3715 | @@ -458,7 +456,7 @@ | |
3716 | exit(0); | |
3717 | } | |
3718 | ||
3719 | - MyFree(m_bn); | |
3720 | + rb_free(m_bn); | |
3721 | return 0; | |
3722 | } | |
3723 | ||
3724 | @@ -759,7 +757,7 @@ | |
3725 | ||
3726 | dlclose(modlist[modindex]->address); | |
3727 | ||
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)); | |
3732 | ||
3733 | @@ -808,7 +806,7 @@ | |
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); | |
3739 | return -1; | |
3740 | } | |
3741 | ||
3742 | @@ -829,7 +827,7 @@ | |
3743 | 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); | |
3748 | return -1; | |
3749 | } | |
3750 | ||
3751 | @@ -846,7 +844,7 @@ | |
3752 | "Module %s indicated failure during load.", | |
3753 | mod_basename); | |
3754 | dlclose(tmpptr); | |
3755 | - MyFree(mod_basename); | |
3756 | + rb_free(mod_basename); | |
3757 | return -1; | |
3758 | } | |
3759 | if(mheader->mapi_command_list) | |
3760 | @@ -881,7 +879,7 @@ | |
3761 | "Module %s has unknown/unsupported MAPI version %d.", | |
3762 | mod_basename, *mapi_version); | |
3763 | dlclose(tmpptr); | |
3764 | - MyFree(mod_basename); | |
3765 | + rb_free(mod_basename); | |
3766 | return -1; | |
3767 | } | |
3768 | ||
3769 | @@ -890,11 +888,11 @@ | |
3770 | ||
3771 | increase_modlist(); | |
3772 | ||
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); | |
3782 | num_mods++; | |
3783 | @@ -908,7 +906,7 @@ | |
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); | |
3786 | } | |
3787 | - MyFree(mod_basename); | |
3788 | + rb_free(mod_basename); | |
3789 | return 0; | |
3790 | } | |
3791 | ||
3792 | @@ -927,11 +925,11 @@ | |
3793 | if((num_mods + 1) < max_mods) | |
3794 | return; | |
3795 | ||
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); | |
3800 | ||
3801 | - MyFree(modlist); | |
3802 | + rb_free(modlist); | |
3803 | modlist = new_modlist; | |
3804 | max_mods += MODS_INCREMENT; | |
3805 | } | |
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 | |
3809 | @@ -32,58 +32,57 @@ | |
3810 | * $Id: monitor.c 3520 2007-06-30 22:15:35Z jilles $ | |
3811 | */ | |
3812 | #include "stdinc.h" | |
3813 | -#include "tools.h" | |
3814 | #include "client.h" | |
3815 | -#include "memory.h" | |
3816 | -#include "balloc.h" | |
3817 | #include "monitor.h" | |
3818 | #include "hash.h" | |
3819 | -#include "event.h" | |
3820 | #include "numeric.h" | |
3821 | ||
3822 | -static struct monitor *monitorTable[MONITOR_HASH_SIZE]; | |
3823 | -BlockHeap *monitor_heap; | |
3824 | - | |
3825 | -static void cleanup_monitor(void *unused); | |
3826 | +struct monitor *monitorTable[MONITOR_HASH_SIZE];\r | |
3827 | +static rb_bh *monitor_heap; | |
3828 | ||
3829 | void | |
3830 | init_monitor(void) | |
3831 | { | |
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"); | |
3835 | } | |
3836 | ||
3837 | static inline unsigned int | |
3838 | hash_monitor_nick(const char *name) | |
3839 | { | |
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); | |
3842 | } | |
3843 | ||
3844 | struct monitor * | |
3845 | find_monitor(const char *name, int add) | |
3846 | { | |
3847 | - struct monitor *monptr; | |
3848 | + struct monitor *monptr;\r | |
3849 | +\r | |
3850 | + unsigned int hashv = hash_monitor_nick(name);\r | |
3851 | +\r | |
3852 | + for(monptr = monitorTable[hashv]; monptr; monptr = monptr->hnext)\r | |
3853 | + {\r | |
3854 | + if(!irccmp(monptr->name, name))\r | |
3855 | + return monptr;\r | |
3856 | + }\r | |
3857 | +\r | |
3858 | + if(add)\r | |
3859 | + {\r | |
3860 | + monptr = rb_bh_alloc(monitor_heap);\r | |
3861 | + rb_strlcpy(monptr->name, name, sizeof(monptr->name));\r | |
3862 | +\r | |
3863 | + monptr->hnext = monitorTable[hashv];\r | |
3864 | + monitorTable[hashv] = monptr;\r | |
3865 | +\r | |
3866 | + return monptr;\r | |
3867 | + }\r | |
3868 | +\r | |
3869 | + return NULL; | |
3870 | +} | |
3871 | ||
3872 | - unsigned int hashv = hash_monitor_nick(name); | |
3873 | - | |
3874 | - for(monptr = monitorTable[hashv]; monptr; monptr = monptr->hnext) | |
3875 | - { | |
3876 | - if(!irccmp(monptr->name, name)) | |
3877 | - return monptr; | |
3878 | - } | |
3879 | - | |
3880 | - if(add) | |
3881 | - { | |
3882 | - monptr = BlockHeapAlloc(monitor_heap); | |
3883 | - strlcpy(monptr->name, name, sizeof(monptr->name)); | |
3884 | - | |
3885 | - monptr->hnext = monitorTable[hashv]; | |
3886 | - monitorTable[hashv] = monptr; | |
3887 | - | |
3888 | - return monptr; | |
3889 | - } | |
3890 | - | |
3891 | - return NULL; | |
3892 | +void\r | |
3893 | +free_monitor(struct monitor *monptr)\r | |
3894 | +{\r | |
3895 | + rb_bh_free(monitor_heap, monptr);\r | |
3896 | } | |
3897 | ||
3898 | /* monitor_signon() | |
3899 | @@ -96,16 +95,15 @@ | |
3900 | void | |
3901 | monitor_signon(struct Client *client_p) | |
3902 | { | |
3903 | - char buf[USERHOST_REPLYLEN]; | |
3904 | - struct monitor *monptr = find_monitor(client_p->name, 0); | |
3905 | - | |
3906 | - /* noones watching this nick */ | |
3907 | - if(monptr == NULL) | |
3908 | - return; | |
3909 | - | |
3910 | - rb_snprintf(buf, sizeof(buf), "%s!%s@%s", | |
3911 | - client_p->name, client_p->username, client_p->host); | |
3912 | - | |
3913 | + char buf[USERHOST_REPLYLEN];\r | |
3914 | + struct monitor *monptr = find_monitor(client_p->name, 0);\r | |
3915 | +\r | |
3916 | + /* noones watching this nick */\r | |
3917 | + if(monptr == NULL)\r | |
3918 | + return;\r | |
3919 | +\r | |
3920 | + rb_snprintf(buf, sizeof(buf), "%s!%s@%s", client_p->name, client_p->username, client_p->host);\r | |
3921 | +\r | |
3922 | sendto_monitor(monptr, form_str(RPL_MONONLINE), me.name, "*", buf); | |
3923 | } | |
3924 | ||
3925 | @@ -119,62 +117,30 @@ | |
3926 | void | |
3927 | monitor_signoff(struct Client *client_p) | |
3928 | { | |
3929 | - struct monitor *monptr = find_monitor(client_p->name, 0); | |
3930 | - | |
3931 | - /* noones watching this nick */ | |
3932 | - if(monptr == NULL) | |
3933 | - return; | |
3934 | - | |
3935 | - sendto_monitor(monptr, form_str(RPL_MONOFFLINE), me.name, "*", | |
3936 | + struct monitor *monptr = find_monitor(client_p->name, 0);\r | |
3937 | +\r | |
3938 | + /* noones watching this nick */\r | |
3939 | + if(monptr == NULL)\r | |
3940 | + return;\r | |
3941 | +\r | |
3942 | + sendto_monitor(monptr, form_str(RPL_MONOFFLINE), me.name, "*",\r | |
3943 | client_p->name); | |
3944 | } | |
3945 | ||
3946 | void | |
3947 | clear_monitor(struct Client *client_p) | |
3948 | { | |
3949 | - struct monitor *monptr; | |
3950 | - rb_dlink_node *ptr, *next_ptr; | |
3951 | - | |
3952 | - RB_DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->monitor_list.head) | |
3953 | - { | |
3954 | - monptr = ptr->data; | |
3955 | - | |
3956 | - /* we leave the actual entry around with no users, itll be | |
3957 | - * cleaned up periodically by cleanup_monitor() --anfl | |
3958 | - */ | |
3959 | - rb_dlinkFindDestroy(client_p, &monptr->users); | |
3960 | - free_rb_dlink_node(ptr); | |
3961 | - } | |
3962 | - | |
3963 | - client_p->localClient->monitor_list.head = client_p->localClient->monitor_list.tail = NULL; | |
3964 | + struct monitor *monptr;\r | |
3965 | + rb_dlink_node *ptr, *next_ptr;\r | |
3966 | +\r | |
3967 | + RB_DLINK_FOREACH_SAFE(ptr, next_ptr, client_p->localClient->monitor_list.head)\r | |
3968 | + {\r | |
3969 | + monptr = ptr->data;\r | |
3970 | +\r | |
3971 | + rb_dlinkFindDestroy(client_p, &monptr->users);\r | |
3972 | + rb_free_rb_dlink_node(ptr);\r | |
3973 | + }\r | |
3974 | +\r | |
3975 | + client_p->localClient->monitor_list.head = client_p->localClient->monitor_list.tail = NULL;\r | |
3976 | client_p->localClient->monitor_list.length = 0; | |
3977 | } | |
3978 | - | |
3979 | -static void | |
3980 | -cleanup_monitor(void *unused) | |
3981 | -{ | |
3982 | - struct monitor *last_ptr = NULL; | |
3983 | - struct monitor *next_ptr, *ptr; | |
3984 | - int i; | |
3985 | - | |
3986 | - for(i = 0; i < MONITOR_HASH_SIZE; i++) | |
3987 | - { | |
3988 | - last_ptr = NULL; | |
3989 | - for(ptr = monitorTable[i]; ptr; ptr = next_ptr) | |
3990 | - { | |
3991 | - next_ptr = ptr->hnext; | |
3992 | - | |
3993 | - if(!rb_dlink_list_length(&ptr->users)) | |
3994 | - { | |
3995 | - if(last_ptr) | |
3996 | - last_ptr->hnext = next_ptr; | |
3997 | - else | |
3998 | - monitorTable[i] = next_ptr; | |
3999 | - | |
4000 | - BlockHeapFree(monitor_heap, ptr); | |
4001 | - } | |
4002 | - else | |
4003 | - last_ptr = ptr; | |
4004 | - } | |
4005 | - } | |
4006 | -} | |
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 | |
4010 | @@ -9,9 +9,7 @@ | |
4011 | #include <openssl/rsa.h> | |
4012 | #endif | |
4013 | ||
4014 | -#include "memory.h" | |
4015 | #include "newconf.h" | |
4016 | -#include "tools.h" | |
4017 | #include "ircd_defs.h" | |
4018 | #include "sprintf_irc.h" | |
4019 | #include "common.h" | |
4020 | @@ -25,7 +23,6 @@ | |
4021 | #include "listener.h" | |
4022 | #include "hostmask.h" | |
4023 | #include "s_serv.h" | |
4024 | -#include "event.h" | |
4025 | #include "hash.h" | |
4026 | #include "cache.h" | |
4027 | #include "ircd.h" | |
4028 | @@ -83,7 +80,7 @@ | |
4029 | { | |
4030 | struct TopConf *tc; | |
4031 | ||
4032 | - tc = MyMalloc(sizeof(struct TopConf)); | |
4033 | + tc = rb_malloc(sizeof(struct TopConf)); | |
4034 | ||
4035 | tc->tc_name = name; | |
4036 | tc->tc_sfunc = sfunc; | |
4037 | @@ -153,7 +150,7 @@ | |
4038 | return -1; | |
4039 | ||
4040 | rb_dlinkDestroy(ptr, &conf_items); | |
4041 | - MyFree(tc); | |
4042 | + rb_free(tc); | |
4043 | ||
4044 | return 0; | |
4045 | } | |
4046 | @@ -194,7 +191,7 @@ | |
4047 | ||
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); | |
4052 | } | |
4053 | } | |
4054 | ||
4055 | @@ -225,8 +222,8 @@ | |
4056 | if((p = strchr((char *) data, ' '))) | |
4057 | *p = '\0'; | |
4058 | ||
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); | |
4063 | } | |
4064 | ||
4065 | static void | |
4066 | @@ -271,7 +268,7 @@ | |
4067 | ||
4068 | load_one_module((char *) data, 0); | |
4069 | ||
4070 | - MyFree(m_bn); | |
4071 | + rb_free(m_bn); | |
4072 | #else | |
4073 | conf_report_error("Ignoring modules::module -- loadable module support not present."); | |
4074 | #endif | |
4075 | @@ -484,7 +481,7 @@ | |
4076 | if(strlen(conf_cur_block_name) > OPERNICKLEN) | |
4077 | conf_cur_block_name[OPERNICKLEN] = '\0'; | |
4078 | ||
4079 | - DupString(yy_oper->name, conf_cur_block_name); | |
4080 | + yy_oper->name = rb_strdup(conf_cur_block_name); | |
4081 | } | |
4082 | ||
4083 | if(EmptyString(yy_oper->name)) | |
4084 | @@ -512,11 +509,11 @@ | |
4085 | { | |
4086 | yy_tmpoper = ptr->data; | |
4087 | ||
4088 | - DupString(yy_tmpoper->name, yy_oper->name); | |
4089 | + yy_tmpoper->name = rb_strdup(yy_oper->name); | |
4090 | ||
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); | |
4095 | ||
4096 | yy_tmpoper->flags = yy_oper->flags; | |
4097 | yy_tmpoper->umodes = yy_oper->umodes; | |
4098 | @@ -582,14 +579,14 @@ | |
4099 | { | |
4100 | *p++ = '\0'; | |
4101 | ||
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); | |
4106 | } | |
4107 | else | |
4108 | { | |
4109 | ||
4110 | - DupString(yy_tmpoper->username, "*"); | |
4111 | - DupString(yy_tmpoper->host, host); | |
4112 | + yy_tmpoper->username = rb_strdup("*"); | |
4113 | + yy_tmpoper->host = rb_strdup(host); | |
4114 | } | |
4115 | ||
4116 | if(EmptyString(yy_tmpoper->username) || EmptyString(yy_tmpoper->host)) | |
4117 | @@ -608,18 +605,18 @@ | |
4118 | if(yy_oper->passwd) | |
4119 | { | |
4120 | memset(yy_oper->passwd, 0, strlen(yy_oper->passwd)); | |
4121 | - MyFree(yy_oper->passwd); | |
4122 | + rb_free(yy_oper->passwd); | |
4123 | } | |
4124 | ||
4125 | - DupString(yy_oper->passwd, (char *) data); | |
4126 | + yy_oper->passwd = rb_strdup((char *) data); | |
4127 | } | |
4128 | ||
4129 | static void | |
4130 | conf_set_oper_rsa_public_key_file(void *data) | |
4131 | { | |
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); | |
4137 | #else | |
4138 | conf_report_error("Warning -- ignoring rsa_public_key_file (OpenSSL support not available"); | |
4139 | #endif | |
4140 | @@ -651,7 +648,7 @@ | |
4141 | conf_end_class(struct TopConf *tc) | |
4142 | { | |
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); | |
4146 | ||
4147 | if(EmptyString(yy_class->class_name)) | |
4148 | { | |
4149 | @@ -734,7 +731,7 @@ | |
4150 | static int | |
4151 | conf_begin_listen(struct TopConf *tc) | |
4152 | { | |
4153 | - MyFree(listener_address); | |
4154 | + rb_free(listener_address); | |
4155 | listener_address = NULL; | |
4156 | return 0; | |
4157 | } | |
4158 | @@ -742,7 +739,7 @@ | |
4159 | static int | |
4160 | conf_end_listen(struct TopConf *tc) | |
4161 | { | |
4162 | - MyFree(listener_address); | |
4163 | + rb_free(listener_address); | |
4164 | listener_address = NULL; | |
4165 | return 0; | |
4166 | } | |
4167 | @@ -786,8 +783,8 @@ | |
4168 | static void | |
4169 | conf_set_listen_address(void *data) | |
4170 | { | |
4171 | - MyFree(listener_address); | |
4172 | - DupString(listener_address, data); | |
4173 | + rb_free(listener_address); | |
4174 | + listener_address = rb_strdup(data); | |
4175 | } | |
4176 | ||
4177 | static int | |
4178 | @@ -819,7 +816,7 @@ | |
4179 | rb_dlink_node *next_ptr; | |
4180 | ||
4181 | if(EmptyString(yy_aconf->name)) | |
4182 | - DupString(yy_aconf->name, "NOMATCH"); | |
4183 | + yy_aconf->name = rb_strdup("NOMATCH"); | |
4184 | ||
4185 | /* didnt even get one ->host? */ | |
4186 | if(EmptyString(yy_aconf->host)) | |
4187 | @@ -839,13 +836,13 @@ | |
4188 | yy_tmp = ptr->data; | |
4189 | ||
4190 | if(yy_aconf->passwd) | |
4191 | - DupString(yy_tmp->passwd, yy_aconf->passwd); | |
4192 | + yy_tmp->passwd = rb_strdup(yy_aconf->passwd); | |
4193 | ||
4194 | /* this will always exist.. */ | |
4195 | - DupString(yy_tmp->name, yy_aconf->name); | |
4196 | + yy_tmp->name = rb_strdup(yy_aconf->name); | |
4197 | ||
4198 | if(yy_aconf->className) | |
4199 | - DupString(yy_tmp->className, yy_aconf->className); | |
4200 | + yy_tmp->className = rb_strdup(yy_aconf->className); | |
4201 | ||
4202 | yy_tmp->flags = yy_aconf->flags; | |
4203 | yy_tmp->port = yy_aconf->port; | |
4204 | @@ -882,13 +879,13 @@ | |
4205 | { | |
4206 | *p++ = '\0'; | |
4207 | ||
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); | |
4212 | } | |
4213 | else | |
4214 | { | |
4215 | - DupString(yy_tmp->user, "*"); | |
4216 | - DupString(yy_tmp->host, data); | |
4217 | + yy_tmp->user = rb_strdup("*"); | |
4218 | + yy_tmp->host = rb_strdup(data); | |
4219 | } | |
4220 | ||
4221 | if(yy_aconf != yy_tmp) | |
4222 | @@ -900,8 +897,8 @@ | |
4223 | { | |
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); | |
4230 | } | |
4231 | ||
4232 | static void | |
4233 | @@ -960,8 +957,8 @@ | |
4234 | return; | |
4235 | } | |
4236 | ||
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; | |
4242 | } | |
4243 | ||
4244 | @@ -977,8 +974,8 @@ | |
4245 | conf_set_auth_redir_serv(void *data) | |
4246 | { | |
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); | |
4252 | } | |
4253 | ||
4254 | static void | |
4255 | @@ -993,8 +990,8 @@ | |
4256 | static void | |
4257 | conf_set_auth_class(void *data) | |
4258 | { | |
4259 | - MyFree(yy_aconf->className); | |
4260 | - DupString(yy_aconf->className, data); | |
4261 | + rb_free(yy_aconf->className); | |
4262 | + yy_aconf->className = rb_strdup(data); | |
4263 | } | |
4264 | ||
4265 | /* ok, shared_oper handles the stacking, shared_flags handles adding | |
4266 | @@ -1041,11 +1038,11 @@ | |
4267 | return; | |
4268 | } | |
4269 | ||
4270 | - DupString(yy_shared->server, args->v.string); | |
4271 | + yy_shared->server = rb_strdup(args->v.string); | |
4272 | args = args->next; | |
4273 | } | |
4274 | else | |
4275 | - DupString(yy_shared->server, "*"); | |
4276 | + yy_shared->server = rb_strdup("*"); | |
4277 | ||
4278 | if((args->type & CF_MTYPE) != CF_QSTRING) | |
4279 | { | |
4280 | @@ -1063,14 +1060,14 @@ | |
4281 | *p++ = '\0'; | |
4282 | ||
4283 | if(EmptyString(p)) | |
4284 | - DupString(yy_shared->host, "*"); | |
4285 | + yy_shared->host = rb_strdup("*"); | |
4286 | else | |
4287 | - DupString(yy_shared->host, p); | |
4288 | + yy_shared->host = rb_strdup(p); | |
4289 | ||
4290 | if(EmptyString(username)) | |
4291 | - DupString(yy_shared->username, "*"); | |
4292 | + yy_shared->username = rb_strdup("*"); | |
4293 | else | |
4294 | - DupString(yy_shared->username, username); | |
4295 | + yy_shared->username = rb_strdup(username); | |
4296 | ||
4297 | rb_dlinkAddAlloc(yy_shared, &yy_shared_list); | |
4298 | yy_shared = NULL; | |
4299 | @@ -1111,7 +1108,7 @@ | |
4300 | yy_server->flags |= SERVER_TB; | |
4301 | ||
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); | |
4305 | ||
4306 | return 0; | |
4307 | } | |
4308 | @@ -1164,8 +1161,8 @@ | |
4309 | static void | |
4310 | conf_set_connect_host(void *data) | |
4311 | { | |
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; | |
4318 | } | |
4319 | @@ -1189,10 +1186,10 @@ | |
4320 | if(yy_server->spasswd) | |
4321 | { | |
4322 | memset(yy_server->spasswd, 0, strlen(yy_server->spasswd)); | |
4323 | - MyFree(yy_server->spasswd); | |
4324 | + rb_free(yy_server->spasswd); | |
4325 | } | |
4326 | ||
4327 | - DupString(yy_server->spasswd, data); | |
4328 | + yy_server->spasswd = rb_strdup(data); | |
4329 | } | |
4330 | ||
4331 | static void | |
4332 | @@ -1201,9 +1198,9 @@ | |
4333 | if(yy_server->passwd) | |
4334 | { | |
4335 | memset(yy_server->passwd, 0, strlen(yy_server->passwd)); | |
4336 | - MyFree(yy_server->passwd); | |
4337 | + rb_free(yy_server->passwd); | |
4338 | } | |
4339 | - DupString(yy_server->passwd, data); | |
4340 | + yy_server->passwd = rb_strdup(data); | |
4341 | } | |
4342 | ||
4343 | static void | |
4344 | @@ -1254,8 +1251,8 @@ | |
4345 | yy_hub = make_remote_conf(); | |
4346 | yy_hub->flags = CONF_HUB; | |
4347 | ||
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); | |
4353 | } | |
4354 | ||
4355 | @@ -1270,16 +1267,16 @@ | |
4356 | yy_leaf = make_remote_conf(); | |
4357 | yy_leaf->flags = CONF_LEAF; | |
4358 | ||
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); | |
4364 | } | |
4365 | ||
4366 | static void | |
4367 | conf_set_connect_class(void *data) | |
4368 | { | |
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); | |
4373 | } | |
4374 | ||
4375 | static void | |
4376 | @@ -1294,8 +1291,8 @@ | |
4377 | } | |
4378 | ||
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); | |
4386 | } | |
4387 | @@ -1327,7 +1324,7 @@ | |
4388 | free_remote_conf(yy_shared); | |
4389 | ||
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); | |
4394 | ||
4395 | yy_shared = NULL; | |
4396 | @@ -1575,7 +1572,7 @@ | |
4397 | return; | |
4398 | } | |
4399 | ||
4400 | - DupString(tmp, data); | |
4401 | + tmp = rb_strdup(data); | |
4402 | rb_dlinkAddAlloc(tmp, &service_list); | |
4403 | ||
4404 | if((target_p = find_server(NULL, tmp))) | |
4405 | @@ -1585,10 +1582,10 @@ | |
4406 | static int | |
4407 | conf_begin_alias(struct TopConf *tc) | |
4408 | { | |
4409 | - yy_alias = MyMalloc(sizeof(struct alias_entry)); | |
4410 | + yy_alias = rb_malloc(sizeof(struct alias_entry)); | |
4411 | ||
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); | |
4415 | ||
4416 | yy_alias->flags = 0; | |
4417 | yy_alias->hits = 0; | |
4418 | @@ -1606,7 +1603,7 @@ | |
4419 | { | |
4420 | conf_report_error("Ignoring alias -- must have a name."); | |
4421 | ||
4422 | - MyFree(yy_alias); | |
4423 | + rb_free(yy_alias); | |
4424 | ||
4425 | return -1; | |
4426 | } | |
4427 | @@ -1615,7 +1612,7 @@ | |
4428 | { | |
4429 | conf_report_error("Ignoring alias -- must have a target."); | |
4430 | ||
4431 | - MyFree(yy_alias); | |
4432 | + rb_free(yy_alias); | |
4433 | ||
4434 | return -1; | |
4435 | } | |
4436 | @@ -1634,7 +1631,7 @@ | |
4437 | if (data == NULL || yy_alias == NULL) /* this shouldn't ever happen */ | |
4438 | return; | |
4439 | ||
4440 | - DupString(yy_alias->name, data); | |
4441 | + yy_alias->name = rb_strdup(data); | |
4442 | } | |
4443 | ||
4444 | static void | |
4445 | @@ -1643,25 +1640,25 @@ | |
4446 | if (data == NULL || yy_alias == NULL) /* this shouldn't ever happen */ | |
4447 | return; | |
4448 | ||
4449 | - DupString(yy_alias->target, data); | |
4450 | + yy_alias->target = rb_strdup(data); | |
4451 | } | |
4452 | ||
4453 | static void | |
4454 | conf_set_blacklist_host(void *data) | |
4455 | { | |
4456 | - DupString(yy_blacklist_host, data); | |
4457 | + yy_blacklist_host = rb_strdup(data); | |
4458 | } | |
4459 | ||
4460 | static void | |
4461 | conf_set_blacklist_reason(void *data) | |
4462 | { | |
4463 | - DupString(yy_blacklist_reason, data); | |
4464 | + yy_blacklist_reason = rb_strdup(data); | |
4465 | ||
4466 | if (yy_blacklist_host && yy_blacklist_reason) | |
4467 | { | |
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; | |
4475 | } | |
4476 | @@ -1700,7 +1697,7 @@ | |
4477 | } | |
4478 | ||
4479 | if(name) | |
4480 | - DupString(conf_cur_block_name, name); | |
4481 | + conf_cur_block_name = rb_strdup(name); | |
4482 | else | |
4483 | conf_cur_block_name = NULL; | |
4484 | ||
4485 | @@ -1717,7 +1714,7 @@ | |
4486 | if(tc->tc_efunc) | |
4487 | return tc->tc_efunc(tc); | |
4488 | ||
4489 | - MyFree(conf_cur_block_name); | |
4490 | + rb_free(conf_cur_block_name); | |
4491 | return 0; | |
4492 | } | |
4493 | ||
4494 | @@ -1736,8 +1733,8 @@ | |
4495 | if(len && strlen(input) > len) | |
4496 | input[len] = '\0'; | |
4497 | ||
4498 | - MyFree(*loc); | |
4499 | - DupString(*loc, input); | |
4500 | + rb_free(*loc); | |
4501 | + *loc = rb_strdup(input); | |
4502 | } | |
4503 | ||
4504 | int | |
4505 | @@ -1779,9 +1776,9 @@ | |
4506 | value->v.list->type = CF_STRING; | |
4507 | ||
4508 | if(cp->v.number == 1) | |
4509 | - DupString(cp->v.string, "yes"); | |
4510 | + cp->v.string = rb_strdup("yes"); | |
4511 | else | |
4512 | - DupString(cp->v.string, "no"); | |
4513 | + cp->v.string = rb_strdup("no"); | |
4514 | } | |
4515 | ||
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) | |
4519 | return -1; | |
4520 | ||
4521 | - cf = MyMalloc(sizeof(struct ConfEntry)); | |
4522 | + cf = rb_malloc(sizeof(struct ConfEntry)); | |
4523 | ||
4524 | cf->cf_name = name; | |
4525 | cf->cf_type = type; | |
4526 | @@ -1878,7 +1875,7 @@ | |
4527 | return -1; | |
4528 | ||
4529 | rb_dlinkDestroy(ptr, &tc->tc_items); | |
4530 | - MyFree(cf); | |
4531 | + rb_free(cf); | |
4532 | ||
4533 | return 0; | |
4534 | } | |
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 | |
4538 | @@ -31,7 +31,6 @@ | |
4539 | #include "numeric.h" | |
4540 | #include "irc_string.h" | |
4541 | #include "common.h" /* NULL cripes */ | |
4542 | -#include "memory.h" | |
4543 | ||
4544 | #include "messages.tab" | |
4545 | ||
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 | |
4549 | @@ -24,8 +24,6 @@ | |
4550 | * $Id: packet.c 3446 2007-05-14 22:21:16Z jilles $ | |
4551 | */ | |
4552 | #include "stdinc.h" | |
4553 | -#include "tools.h" | |
4554 | -#include "commio.h" | |
4555 | #include "s_conf.h" | |
4556 | #include "s_serv.h" | |
4557 | #include "client.h" | |
4558 | @@ -34,7 +32,6 @@ | |
4559 | #include "parse.h" | |
4560 | #include "packet.h" | |
4561 | #include "irc_string.h" | |
4562 | -#include "memory.h" | |
4563 | #include "hook.h" | |
4564 | #include "send.h" | |
4565 | ||
4566 | @@ -285,7 +282,7 @@ | |
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); | |
4572 | } | |
4573 | ||
4574 | if(reply->gotdatalen < 2) | |
4575 | @@ -322,7 +319,7 @@ | |
4576 | ||
4577 | /* reset SlinkRpl */ | |
4578 | if(reply->datalen > 0) | |
4579 | - MyFree(reply->data); | |
4580 | + rb_free(reply->data); | |
4581 | reply->command = 0; | |
4582 | ||
4583 | if(IsAnyDead(server)) | |
4584 | @@ -377,8 +374,8 @@ | |
4585 | call_hook(h_iorecv_id, &hdata); | |
4586 | #endif | |
4587 | ||
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; | |
4593 | ||
4594 | /* | |
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 | |
4598 | @@ -40,7 +40,6 @@ | |
4599 | #include "send.h" | |
4600 | #include "msg.h" | |
4601 | #include "s_conf.h" | |
4602 | -#include "memory.h" | |
4603 | #include "s_serv.h" | |
4604 | #include "packet.h" | |
4605 | ||
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 | |
4609 | @@ -28,8 +28,6 @@ | |
4610 | #include "patricia.h" | |
4611 | #include "client.h" | |
4612 | #include "s_conf.h" | |
4613 | -#include "event.h" | |
4614 | -#include "tools.h" | |
4615 | #include "reject.h" | |
4616 | #include "s_stats.h" | |
4617 | #include "msg.h" | |
4618 | @@ -100,11 +98,11 @@ | |
4619 | pnode = ptr->data; | |
4620 | rdata = pnode->data; | |
4621 | ||
4622 | - if(rdata->time + ConfigFileEntry.reject_duration > CurrentTime) | |
4623 | + if(rdata->time + ConfigFileEntry.reject_duration > rb_current_time()) | |
4624 | continue; | |
4625 | ||
4626 | rb_dlinkDelete(ptr, &reject_list); | |
4627 | - MyFree(rdata); | |
4628 | + rb_free(rdata); | |
4629 | patricia_remove(reject_tree, pnode); | |
4630 | } | |
4631 | } | |
4632 | @@ -139,7 +137,7 @@ | |
4633 | if((pnode = match_ip(reject_tree, (struct sockaddr *)&client_p->localClient->ip)) != NULL) | |
4634 | { | |
4635 | rdata = pnode->data; | |
4636 | - rdata->time = CurrentTime; | |
4637 | + rdata->time = rb_current_time(); | |
4638 | rdata->count++; | |
4639 | } | |
4640 | else | |
4641 | @@ -150,9 +148,9 @@ | |
4642 | bitlen = 128; | |
4643 | #endif | |
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(); | |
4650 | rdata->count = 1; | |
4651 | } | |
4652 | rdata->mask_hashv = hashv; | |
4653 | @@ -174,7 +172,7 @@ | |
4654 | { | |
4655 | rdata = pnode->data; | |
4656 | ||
4657 | - rdata->time = CurrentTime; | |
4658 | + rdata->time = rb_current_time(); | |
4659 | if(rdata->count > ConfigFileEntry.reject_after_count) | |
4660 | { | |
4661 | ServerStats->is_rej++; | |
4662 | @@ -201,7 +199,7 @@ | |
4663 | pnode = ptr->data; | |
4664 | rdata = pnode->data; | |
4665 | rb_dlinkDelete(ptr, &reject_list); | |
4666 | - MyFree(rdata); | |
4667 | + rb_free(rdata); | |
4668 | patricia_remove(reject_tree, pnode); | |
4669 | } | |
4670 | } | |
4671 | @@ -220,7 +218,7 @@ | |
4672 | { | |
4673 | struct reject_data *rdata = pnode->data; | |
4674 | rb_dlinkDelete(&rdata->rnode, &reject_list); | |
4675 | - MyFree(rdata); | |
4676 | + rb_free(rdata); | |
4677 | patricia_remove(reject_tree, pnode); | |
4678 | return 1; | |
4679 | } | |
4680 | @@ -248,7 +246,7 @@ | |
4681 | if (rdata->mask_hashv == hashv) | |
4682 | { | |
4683 | rb_dlinkDelete(ptr, &reject_list); | |
4684 | - MyFree(rdata); | |
4685 | + rb_free(rdata); | |
4686 | patricia_remove(reject_tree, pnode); | |
4687 | n++; | |
4688 | } | |
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 | |
4692 | @@ -29,11 +29,8 @@ | |
4693 | #include "ircd_defs.h" | |
4694 | #include "common.h" | |
4695 | #include "ircd.h" | |
4696 | -#include "commio.h" | |
4697 | #include "res.h" | |
4698 | #include "reslib.h" | |
4699 | -#include "tools.h" | |
4700 | -#include "event.h" | |
4701 | #include "irc_string.h" | |
4702 | #include "sprintf_irc.h" | |
4703 | #include "numeric.h" | |
4704 | @@ -215,7 +212,7 @@ | |
4705 | */ | |
4706 | static void timeout_resolver(void *notused) | |
4707 | { | |
4708 | - timeout_query_list(CurrentTime); | |
4709 | + timeout_query_list(rb_current_time()); | |
4710 | } | |
4711 | ||
4712 | /* | |
4713 | @@ -244,7 +241,7 @@ | |
4714 | void init_resolver(void) | |
4715 | { | |
4716 | #ifdef HAVE_SRAND48 | |
4717 | - srand48(CurrentTime); | |
4718 | + srand48(rb_current_time()); | |
4719 | #endif | |
4720 | start_resolver(); | |
4721 | } | |
4722 | @@ -290,8 +287,8 @@ | |
4723 | static void rem_request(struct reslist *request) | |
4724 | { | |
4725 | rb_dlinkDelete(&request->node, &request_list); | |
4726 | - MyFree(request->name); | |
4727 | - MyFree(request); | |
4728 | + rb_free(request->name); | |
4729 | + rb_free(request); | |
4730 | } | |
4731 | ||
4732 | /* | |
4733 | @@ -299,9 +296,9 @@ | |
4734 | */ | |
4735 | static struct reslist *make_request(struct DNSQuery *query) | |
4736 | { | |
4737 | - struct reslist *request = MyMalloc(sizeof(struct reslist)); | |
4738 | + struct reslist *request = rb_malloc(sizeof(struct reslist)); | |
4739 | ||
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. */ | |
4745 | @@ -414,7 +411,7 @@ | |
4746 | if (request == NULL) | |
4747 | { | |
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; | |
4753 | } | |
4754 | @@ -436,7 +433,7 @@ | |
4755 | { | |
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); | |
4760 | } | |
4761 | ||
4762 | if (addr->ss_family == AF_INET) | |
4763 | @@ -834,7 +831,7 @@ | |
4764 | */ | |
4765 | reply = make_dnsreply(request); | |
4766 | (*request->query->callback) (request->query->ptr, reply); | |
4767 | - MyFree(reply); | |
4768 | + rb_free(reply); | |
4769 | rem_request(request); | |
4770 | } | |
4771 | } | |
4772 | @@ -851,7 +848,7 @@ | |
4773 | struct DNSReply *cp; | |
4774 | s_assert(request != 0); | |
4775 | ||
4776 | - cp = (struct DNSReply *)MyMalloc(sizeof(struct DNSReply)); | |
4777 | + cp = (struct DNSReply *)rb_malloc(sizeof(struct DNSReply)); | |
4778 | ||
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 | |
4784 | @@ -84,11 +84,8 @@ | |
4785 | #include "ircd_defs.h" | |
4786 | #include "common.h" | |
4787 | #include "ircd.h" | |
4788 | -#include "commio.h" | |
4789 | #include "res.h" | |
4790 | #include "reslib.h" | |
4791 | -#include "tools.h" | |
4792 | -#include "event.h" | |
4793 | #include "irc_string.h" | |
4794 | #include "sprintf_irc.h" | |
4795 | ||
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 | |
4799 | @@ -25,14 +25,12 @@ | |
4800 | */ | |
4801 | ||
4802 | #include "stdinc.h" | |
4803 | -#include "tools.h" | |
4804 | #include "restart.h" | |
4805 | #include "common.h" | |
4806 | #include "ircd.h" | |
4807 | #include "send.h" | |
4808 | #include "s_log.h" | |
4809 | #include "client.h" /* for FLAGS_ALL */ | |
4810 | -#include "memory.h" | |
4811 | ||
4812 | /* external var */ | |
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 | |
4817 | @@ -35,23 +35,19 @@ | |
4818 | */ | |
4819 | #include "stdinc.h" | |
4820 | #include "config.h" | |
4821 | -#include "tools.h" | |
4822 | #include "s_auth.h" | |
4823 | #include "s_conf.h" | |
4824 | #include "client.h" | |
4825 | #include "common.h" | |
4826 | -#include "event.h" | |
4827 | #include "irc_string.h" | |
4828 | #include "sprintf_irc.h" | |
4829 | #include "ircd.h" | |
4830 | #include "numeric.h" | |
4831 | #include "packet.h" | |
4832 | #include "res.h" | |
4833 | -#include "commio.h" | |
4834 | #include "s_log.h" | |
4835 | #include "s_stats.h" | |
4836 | #include "send.h" | |
4837 | -#include "memory.h" | |
4838 | #include "hook.h" | |
4839 | #include "blacklist.h" | |
4840 | ||
4841 | @@ -120,7 +116,7 @@ | |
4842 | client->localClient->auth_request = request; | |
4843 | request->fd = -1; | |
4844 | request->client = client; | |
4845 | - request->timeout = CurrentTime + ConfigFileEntry.connect_timeout; | |
4846 | + request->timeout = rb_current_time() + ConfigFileEntry.connect_timeout; | |
4847 | return request; | |
4848 | } | |
4849 | ||
4850 | @@ -437,7 +433,7 @@ | |
4851 | { | |
4852 | auth = ptr->data; | |
4853 | ||
4854 | - if(auth->timeout < CurrentTime) | |
4855 | + if(auth->timeout < rb_current_time()) | |
4856 | { | |
4857 | if(auth->fd >= 0) | |
4858 | rb_close(auth->fd); | |
4859 | @@ -456,7 +452,7 @@ | |
4860 | sendheader(auth->client, REPORT_FAIL_DNS); | |
4861 | } | |
4862 | ||
4863 | - auth->client->localClient->lasttime = CurrentTime; | |
4864 | + auth->client->localClient->lasttime = rb_current_time(); | |
4865 | release_auth_client(auth); | |
4866 | } | |
4867 | } | |
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 | |
4871 | @@ -26,7 +26,6 @@ | |
4872 | ||
4873 | #include "stdinc.h" | |
4874 | #include "ircd_defs.h" | |
4875 | -#include "tools.h" | |
4876 | #include "s_conf.h" | |
4877 | #include "s_newconf.h" | |
4878 | #include "s_serv.h" | |
4879 | @@ -35,7 +34,6 @@ | |
4880 | #include "class.h" | |
4881 | #include "client.h" | |
4882 | #include "common.h" | |
4883 | -#include "event.h" | |
4884 | #include "hash.h" | |
4885 | #include "irc_string.h" | |
4886 | #include "sprintf_irc.h" | |
4887 | @@ -44,12 +42,9 @@ | |
4888 | #include "hostmask.h" | |
4889 | #include "modules.h" | |
4890 | #include "numeric.h" | |
4891 | -#include "commio.h" | |
4892 | #include "s_log.h" | |
4893 | #include "send.h" | |
4894 | #include "s_gline.h" | |
4895 | -#include "memory.h" | |
4896 | -#include "balloc.h" | |
4897 | #include "patricia.h" | |
4898 | #include "reject.h" | |
4899 | #include "cache.h" | |
4900 | @@ -144,12 +139,12 @@ | |
4901 | if(aconf->spasswd) | |
4902 | memset(aconf->spasswd, 0, strlen(aconf->spasswd)); | |
4903 | ||
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); | |
4916 | ||
4917 | BlockHeapFree(confitem_heap, aconf); | |
4918 | } | |
4919 | @@ -722,8 +717,8 @@ | |
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); | |
4927 | ||
4928 | memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip)); | |
4929 | ServerInfo.specific_ipv4_vhost = 0; | |
4930 | @@ -738,9 +733,9 @@ | |
4931 | AdminInfo.email = NULL; | |
4932 | AdminInfo.description = NULL; | |
4933 | ||
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"); | |
4940 | ||
4941 | ConfigFileEntry.default_umodes = UMODE_INVISIBLE; | |
4942 | ConfigFileEntry.failed_oper_notice = YES; | |
4943 | @@ -794,7 +789,7 @@ | |
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; | |
4954 | ||
4955 | if(ConfigFileEntry.servlink_path == NULL) | |
4956 | - DupString(ConfigFileEntry.servlink_path, SLPATH); | |
4957 | + ConfigFileEntry.servlink_path = rb_strdup(SLPATH); | |
4958 | ||
4959 | if(ServerInfo.network_name == NULL) | |
4960 | - DupString(ServerInfo.network_name, NETWORK_NAME_DEFAULT); | |
4961 | + ServerInfo.network_name = rb_strdup(NETWORK_NAME_DEFAULT); | |
4962 | ||
4963 | if(ServerInfo.network_desc == NULL) | |
4964 | - DupString(ServerInfo.network_desc, NETWORK_DESC_DEFAULT); | |
4965 | + ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT); | |
4966 | ||
4967 | if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) || | |
4968 | (ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX)) | |
4969 | @@ -940,17 +935,17 @@ | |
4970 | void | |
4971 | add_temp_kline(struct ConfItem *aconf) | |
4972 | { | |
4973 | - if(aconf->hold >= CurrentTime + (10080 * 60)) | |
4974 | + if(aconf->hold >= rb_current_time() + (10080 * 60)) | |
4975 | { | |
4976 | rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_WEEK]); | |
4977 | aconf->port = TEMP_WEEK; | |
4978 | } | |
4979 | - else if(aconf->hold >= CurrentTime + (1440 * 60)) | |
4980 | + else if(aconf->hold >= rb_current_time() + (1440 * 60)) | |
4981 | { | |
4982 | rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_DAY]); | |
4983 | aconf->port = TEMP_DAY; | |
4984 | } | |
4985 | - else if(aconf->hold >= CurrentTime + (60 * 60)) | |
4986 | + else if(aconf->hold >= rb_current_time() + (60 * 60)) | |
4987 | { | |
4988 | rb_dlinkAddAlloc(aconf, &temp_klines[TEMP_HOUR]); | |
4989 | aconf->port = TEMP_HOUR; | |
4990 | @@ -974,17 +969,17 @@ | |
4991 | void | |
4992 | add_temp_dline(struct ConfItem *aconf) | |
4993 | { | |
4994 | - if(aconf->hold >= CurrentTime + (10080 * 60)) | |
4995 | + if(aconf->hold >= rb_current_time() + (10080 * 60)) | |
4996 | { | |
4997 | rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_WEEK]); | |
4998 | aconf->port = TEMP_WEEK; | |
4999 | } | |
5000 | - else if(aconf->hold >= CurrentTime + (1440 * 60)) | |
5001 | + else if(aconf->hold >= rb_current_time() + (1440 * 60)) | |
5002 | { | |
5003 | rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_DAY]); | |
5004 | aconf->port = TEMP_DAY; | |
5005 | } | |
5006 | - else if(aconf->hold >= CurrentTime + (60 * 60)) | |
5007 | + else if(aconf->hold >= rb_current_time() + (60 * 60)) | |
5008 | { | |
5009 | rb_dlinkAddAlloc(aconf, &temp_dlines[TEMP_HOUR]); | |
5010 | aconf->port = TEMP_HOUR; | |
5011 | @@ -1017,7 +1012,7 @@ | |
5012 | { | |
5013 | aconf = ptr->data; | |
5014 | ||
5015 | - if(aconf->hold <= CurrentTime) | |
5016 | + if(aconf->hold <= rb_current_time()) | |
5017 | { | |
5018 | /* Alert opers that a TKline expired - Hwy */ | |
5019 | if(ConfigFileEntry.tkline_expire_notices) | |
5020 | @@ -1042,7 +1037,7 @@ | |
5021 | { | |
5022 | aconf = ptr->data; | |
5023 | ||
5024 | - if(aconf->hold < (CurrentTime + (60 * 60))) | |
5025 | + if(aconf->hold < (rb_current_time() + (60 * 60))) | |
5026 | { | |
5027 | rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ? | |
5028 | &temp_klines[TEMP_MIN] : &temp_dlines[TEMP_MIN]); | |
5029 | @@ -1050,14 +1045,14 @@ | |
5030 | } | |
5031 | else if(aconf->port > TEMP_HOUR) | |
5032 | { | |
5033 | - if(aconf->hold < (CurrentTime + (1440 * 60))) | |
5034 | + if(aconf->hold < (rb_current_time() + (1440 * 60))) | |
5035 | { | |
5036 | rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ? | |
5037 | &temp_klines[TEMP_HOUR] : &temp_dlines[TEMP_HOUR]); | |
5038 | aconf->port = TEMP_HOUR; | |
5039 | } | |
5040 | else if(aconf->port > TEMP_DAY && | |
5041 | - (aconf->hold < (CurrentTime + (10080 * 60)))) | |
5042 | + (aconf->hold < (rb_current_time() + (10080 * 60)))) | |
5043 | { | |
5044 | rb_dlinkMoveNode(ptr, list, (aconf->status == CONF_KILL) ? | |
5045 | &temp_klines[TEMP_DAY] : &temp_dlines[TEMP_DAY]); | |
5046 | @@ -1198,9 +1193,9 @@ | |
5047 | { | |
5048 | struct alias_entry *aptr = ptr->data; | |
5049 | ||
5050 | - MyFree(aptr->name); | |
5051 | - MyFree(aptr->target); | |
5052 | - MyFree(aptr); | |
5053 | + rb_free(aptr->name); | |
5054 | + rb_free(aptr->target); | |
5055 | + rb_free(aptr); | |
5056 | } | |
5057 | ||
5058 | /* | |
5059 | @@ -1238,19 +1233,19 @@ | |
5060 | #endif | |
5061 | ||
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; | |
5072 | ||
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; | |
5083 | ||
5084 | /* operator{} and class{} blocks are freed above */ | |
5085 | @@ -1262,12 +1257,12 @@ | |
5086 | */ | |
5087 | ||
5088 | /* clean out general */ | |
5089 | - MyFree(ConfigFileEntry.servlink_path); | |
5090 | + rb_free(ConfigFileEntry.servlink_path); | |
5091 | ConfigFileEntry.servlink_path = NULL; | |
5092 | ||
5093 | RB_DLINK_FOREACH_SAFE(ptr, next_ptr, service_list.head) | |
5094 | { | |
5095 | - MyFree(ptr->data); | |
5096 | + rb_free(ptr->data); | |
5097 | rb_dlinkDestroy(ptr, &service_list); | |
5098 | } | |
5099 | ||
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()); | |
5106 | } | |
5107 | else if(type == DLINE_TYPE) | |
5108 | { | |
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()); | |
5113 | } | |
5114 | else if(type == RESV_TYPE) | |
5115 | { | |
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()); | |
5119 | } | |
5120 | ||
5121 | if(fputs(buffer, out) == -1) | |
5122 | @@ -1449,7 +1444,7 @@ | |
5123 | { | |
5124 | if(aconf->className == NULL) | |
5125 | { | |
5126 | - DupString(aconf->className, "default"); | |
5127 | + aconf->className = rb_strdup("default"); | |
5128 | ClassPtr(aconf) = default_class; | |
5129 | return; | |
5130 | } | |
5131 | @@ -1465,16 +1460,16 @@ | |
5132 | aconf->className, aconf->user, aconf->host); | |
5133 | } | |
5134 | ||
5135 | - MyFree(aconf->className); | |
5136 | - DupString(aconf->className, "default"); | |
5137 | + rb_free(aconf->className); | |
5138 | + aconf->className = rb_strdup("default"); | |
5139 | return; | |
5140 | } | |
5141 | ||
5142 | if(ConfMaxUsers(aconf) < 0) | |
5143 | { | |
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"); | |
5149 | return; | |
5150 | } | |
5151 | } | |
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 | |
5155 | @@ -25,7 +25,6 @@ | |
5156 | */ | |
5157 | ||
5158 | #include "stdinc.h" | |
5159 | -#include "tools.h" | |
5160 | #include "channel.h" | |
5161 | #include "client.h" | |
5162 | #include "common.h" | |
5163 | @@ -34,7 +33,6 @@ | |
5164 | #include "ircd.h" | |
5165 | #include "hostmask.h" | |
5166 | #include "numeric.h" | |
5167 | -#include "commio.h" | |
5168 | #include "s_conf.h" | |
5169 | #include "scache.h" | |
5170 | #include "send.h" | |
5171 | @@ -42,8 +40,6 @@ | |
5172 | #include "s_serv.h" | |
5173 | #include "s_gline.h" | |
5174 | #include "hash.h" | |
5175 | -#include "event.h" | |
5176 | -#include "memory.h" | |
5177 | ||
5178 | rb_dlink_list glines; | |
5179 | ||
5180 | @@ -125,7 +121,7 @@ | |
5181 | kill_ptr = gline_node->data; | |
5182 | ||
5183 | /* these are in chronological order */ | |
5184 | - if(kill_ptr->hold > CurrentTime) | |
5185 | + if(kill_ptr->hold > rb_current_time()) | |
5186 | break; | |
5187 | ||
5188 | rb_dlinkDestroy(gline_node, &glines); | |
5189 | @@ -155,12 +151,12 @@ | |
5190 | glp_ptr = pending_node->data; | |
5191 | ||
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)) | |
5195 | ||
5196 | { | |
5197 | - MyFree(glp_ptr->reason1); | |
5198 | - MyFree(glp_ptr->reason2); | |
5199 | - MyFree(glp_ptr); | |
5200 | + rb_free(glp_ptr->reason1); | |
5201 | + rb_free(glp_ptr->reason2); | |
5202 | + rb_free(glp_ptr); | |
5203 | rb_dlinkDestroy(pending_node, &pending_glines); | |
5204 | } | |
5205 | } | |
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 | |
5209 | @@ -210,7 +210,7 @@ | |
5210 | { | |
5211 | static char buf[MAX_DATE_STRING]; | |
5212 | struct tm *lt; | |
5213 | - time_t ltime = CurrentTime; | |
5214 | + time_t ltime = rb_current_time(); | |
5215 | ||
5216 | lt = localtime(<ime); | |
5217 | ||
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 | |
5221 | @@ -37,16 +37,12 @@ | |
5222 | #include "common.h" | |
5223 | #include "s_conf.h" | |
5224 | #include "s_newconf.h" | |
5225 | -#include "tools.h" | |
5226 | #include "client.h" | |
5227 | -#include "memory.h" | |
5228 | #include "s_serv.h" | |
5229 | #include "send.h" | |
5230 | #include "hostmask.h" | |
5231 | #include "newconf.h" | |
5232 | #include "hash.h" | |
5233 | -#include "balloc.h" | |
5234 | -#include "event.h" | |
5235 | #include "sprintf_irc.h" | |
5236 | #include "irc_dictionary.h" | |
5237 | ||
5238 | @@ -157,7 +153,7 @@ | |
5239 | struct remote_conf * | |
5240 | make_remote_conf(void) | |
5241 | { | |
5242 | - struct remote_conf *remote_p = MyMalloc(sizeof(struct remote_conf)); | |
5243 | + struct remote_conf *remote_p = rb_malloc(sizeof(struct remote_conf)); | |
5244 | return remote_p; | |
5245 | } | |
5246 | ||
5247 | @@ -168,10 +164,10 @@ | |
5248 | if(remote_p == NULL) | |
5249 | return; | |
5250 | ||
5251 | - MyFree(remote_p->username); | |
5252 | - MyFree(remote_p->host); | |
5253 | - MyFree(remote_p->server); | |
5254 | - MyFree(remote_p); | |
5255 | + rb_free(remote_p->username); | |
5256 | + rb_free(remote_p->host); | |
5257 | + rb_free(remote_p->server); | |
5258 | + rb_free(remote_p); | |
5259 | } | |
5260 | ||
5261 | int | |
5262 | @@ -250,7 +246,7 @@ | |
5263 | struct oper_conf * | |
5264 | make_oper_conf(void) | |
5265 | { | |
5266 | - struct oper_conf *oper_p = MyMalloc(sizeof(struct oper_conf)); | |
5267 | + struct oper_conf *oper_p = rb_malloc(sizeof(struct oper_conf)); | |
5268 | return oper_p; | |
5269 | } | |
5270 | ||
5271 | @@ -261,24 +257,24 @@ | |
5272 | if(oper_p == NULL) | |
5273 | return; | |
5274 | ||
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); | |
5281 | ||
5282 | if(oper_p->passwd) | |
5283 | { | |
5284 | memset(oper_p->passwd, 0, strlen(oper_p->passwd)); | |
5285 | - MyFree(oper_p->passwd); | |
5286 | + rb_free(oper_p->passwd); | |
5287 | } | |
5288 | ||
5289 | #ifdef HAVE_LIBCRYPTO | |
5290 | - MyFree(oper_p->rsa_pubkey_file); | |
5291 | + rb_free(oper_p->rsa_pubkey_file); | |
5292 | ||
5293 | if(oper_p->rsa_pubkey) | |
5294 | RSA_free(oper_p->rsa_pubkey); | |
5295 | #endif | |
5296 | ||
5297 | - MyFree(oper_p); | |
5298 | + rb_free(oper_p); | |
5299 | } | |
5300 | ||
5301 | struct oper_conf * | |
5302 | @@ -373,7 +369,7 @@ | |
5303 | struct server_conf * | |
5304 | make_server_conf(void) | |
5305 | { | |
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; | |
5309 | return server_p; | |
5310 | } | |
5311 | @@ -388,19 +384,19 @@ | |
5312 | if(!EmptyString(server_p->passwd)) | |
5313 | { | |
5314 | memset(server_p->passwd, 0, strlen(server_p->passwd)); | |
5315 | - MyFree(server_p->passwd); | |
5316 | + rb_free(server_p->passwd); | |
5317 | } | |
5318 | ||
5319 | if(!EmptyString(server_p->spasswd)) | |
5320 | { | |
5321 | memset(server_p->spasswd, 0, strlen(server_p->spasswd)); | |
5322 | - MyFree(server_p->spasswd); | |
5323 | + rb_free(server_p->spasswd); | |
5324 | } | |
5325 | ||
5326 | - MyFree(server_p->name); | |
5327 | - MyFree(server_p->host); | |
5328 | - MyFree(server_p->class_name); | |
5329 | - MyFree(server_p); | |
5330 | + rb_free(server_p->name); | |
5331 | + rb_free(server_p->host); | |
5332 | + rb_free(server_p->class_name); | |
5333 | + rb_free(server_p); | |
5334 | } | |
5335 | ||
5336 | void | |
5337 | @@ -408,7 +404,7 @@ | |
5338 | { | |
5339 | if(EmptyString(server_p->class_name)) | |
5340 | { | |
5341 | - DupString(server_p->class_name, "default"); | |
5342 | + server_p->class_name = rb_strdup("default"); | |
5343 | server_p->class = default_class; | |
5344 | return; | |
5345 | } | |
5346 | @@ -420,8 +416,8 @@ | |
5347 | conf_report_error("Warning connect::class invalid for %s", | |
5348 | server_p->name); | |
5349 | ||
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"); | |
5354 | } | |
5355 | ||
5356 | if(strchr(server_p->host, '*') || strchr(server_p->host, '?')) | |
5357 | @@ -697,7 +693,7 @@ | |
5358 | { | |
5359 | aconf = ptr->data; | |
5360 | ||
5361 | - if(aconf->hold && aconf->hold <= CurrentTime) | |
5362 | + if(aconf->hold && aconf->hold <= rb_current_time()) | |
5363 | { | |
5364 | if(ConfigFileEntry.tkline_expire_notices) | |
5365 | sendto_realops_snomask(SNO_GENERAL, L_ALL, | |
5366 | @@ -714,7 +710,7 @@ | |
5367 | { | |
5368 | aconf = ptr->data; | |
5369 | ||
5370 | - if(aconf->hold && aconf->hold <= CurrentTime) | |
5371 | + if(aconf->hold && aconf->hold <= rb_current_time()) | |
5372 | { | |
5373 | if(ConfigFileEntry.tkline_expire_notices) | |
5374 | sendto_realops_snomask(SNO_GENERAL, L_ALL, | |
5375 | @@ -729,7 +725,7 @@ | |
5376 | { | |
5377 | aconf = ptr->data; | |
5378 | ||
5379 | - if(aconf->hold && aconf->hold <= CurrentTime) | |
5380 | + if(aconf->hold && aconf->hold <= rb_current_time()) | |
5381 | { | |
5382 | if(ConfigFileEntry.tkline_expire_notices) | |
5383 | sendto_realops_snomask(SNO_GENERAL, L_ALL, | |
5384 | @@ -758,7 +754,7 @@ | |
5385 | nd = BlockHeapAlloc(nd_heap); | |
5386 | ||
5387 | strlcpy(nd->name, name, sizeof(nd->name)); | |
5388 | - nd->expire = CurrentTime + ConfigFileEntry.nick_delay; | |
5389 | + nd->expire = rb_current_time() + ConfigFileEntry.nick_delay; | |
5390 | ||
5391 | /* this list is ordered */ | |
5392 | rb_dlinkAddTail(nd, &nd->lnode, &nd_list); | |
5393 | @@ -789,7 +785,7 @@ | |
5394 | /* this list is ordered - we can stop when we hit the first | |
5395 | * entry that doesnt expire.. | |
5396 | */ | |
5397 | - if(nd->expire > CurrentTime) | |
5398 | + if(nd->expire > rb_current_time()) | |
5399 | return; | |
5400 | ||
5401 | free_nd_entry(nd); | |
5402 | @@ -805,14 +801,14 @@ | |
5403 | if(find_tgchange(host)) | |
5404 | return; | |
5405 | ||
5406 | - target = MyMalloc(sizeof(tgchange)); | |
5407 | + target = rb_malloc(sizeof(tgchange)); | |
5408 | pnode = make_and_lookup(tgchange_tree, host); | |
5409 | ||
5410 | pnode->data = target; | |
5411 | target->pnode = pnode; | |
5412 | ||
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); | |
5417 | ||
5418 | rb_dlinkAdd(target, &target->node, &tgchange_list); | |
5419 | } | |
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 | |
5423 | @@ -30,12 +30,10 @@ | |
5424 | #include <openssl/rsa.h> | |
5425 | #endif | |
5426 | ||
5427 | -#include "tools.h" | |
5428 | #include "s_serv.h" | |
5429 | #include "class.h" | |
5430 | #include "client.h" | |
5431 | #include "common.h" | |
5432 | -#include "event.h" | |
5433 | #include "hash.h" | |
5434 | #include "irc_string.h" | |
5435 | #include "sprintf_irc.h" | |
5436 | @@ -44,7 +42,6 @@ | |
5437 | #include "numeric.h" | |
5438 | #include "packet.h" | |
5439 | #include "res.h" | |
5440 | -#include "commio.h" | |
5441 | #include "s_conf.h" | |
5442 | #include "s_newconf.h" | |
5443 | #include "s_log.h" | |
5444 | @@ -53,7 +50,6 @@ | |
5445 | #include "scache.h" | |
5446 | #include "send.h" | |
5447 | #include "client.h" | |
5448 | -#include "memory.h" | |
5449 | #include "channel.h" /* chcap_usage_counts stuff... */ | |
5450 | #include "hook.h" | |
5451 | #include "msg.h" | |
5452 | @@ -218,7 +214,7 @@ | |
5453 | /* only bother if we haven't already got something queued... */ | |
5454 | if(!target_p->localClient->slinkq) | |
5455 | { | |
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; | |
5461 | @@ -374,7 +370,7 @@ | |
5462 | * made one successfull connection... [this algorithm is | |
5463 | * a bit fuzzy... -- msa >;) ] | |
5464 | */ | |
5465 | - if(tmp_p->hold > CurrentTime) | |
5466 | + if(tmp_p->hold > rb_current_time()) | |
5467 | { | |
5468 | if(next > tmp_p->hold || next == 0) | |
5469 | next = tmp_p->hold; | |
5470 | @@ -382,7 +378,7 @@ | |
5471 | } | |
5472 | ||
5473 | confrq = get_con_freq(cltmp); | |
5474 | - tmp_p->hold = CurrentTime + confrq; | |
5475 | + tmp_p->hold = rb_current_time() + confrq; | |
5476 | ||
5477 | /* | |
5478 | * Found a CONNECT config with port specified, scan clients | |
5479 | @@ -1020,7 +1016,7 @@ | |
5480 | if(client_p->localClient->passwd) | |
5481 | { | |
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; | |
5486 | } | |
5487 | ||
5488 | @@ -1083,7 +1079,7 @@ | |
5489 | SetServlink(client_p); | |
5490 | } | |
5491 | ||
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()); | |
5494 | ||
5495 | client_p->servptr = &me; | |
5496 | ||
5497 | @@ -1111,13 +1107,13 @@ | |
5498 | ||
5499 | if(client_p->localClient->fullcaps) | |
5500 | { | |
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; | |
5506 | } | |
5507 | ||
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 */ | |
5512 | ||
5513 | if((rb_dlink_list_length(&lclient_list) + rb_dlink_list_length(&serv_list)) > | |
5514 | @@ -1251,7 +1247,7 @@ | |
5515 | int linecount = 0; | |
5516 | int linelen; | |
5517 | ||
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 */ | |
5520 | ||
5521 | if(IsCapable(server, CAP_ZIP)) | |
5522 | { | |
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 | |
5526 | @@ -30,9 +30,7 @@ | |
5527 | #include "irc_string.h" | |
5528 | #include "ircd.h" | |
5529 | #include "numeric.h" | |
5530 | -#include "commio.h" | |
5531 | #include "send.h" | |
5532 | -#include "memory.h" | |
5533 | #include "s_conf.h" | |
5534 | #include "s_newconf.h" | |
5535 | #include "whowas.h" | |
5536 | @@ -78,7 +76,7 @@ | |
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; | |
5542 | sp->is_sv++; | |
5543 | if(sp->is_sbs > 1023) | |
5544 | { | |
5545 | @@ -100,7 +98,7 @@ | |
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; | |
5551 | sp->is_cl++; | |
5552 | if(sp->is_cbs > 1023) | |
5553 | { | |
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 | |
5557 | @@ -25,7 +25,6 @@ | |
5558 | */ | |
5559 | ||
5560 | #include "stdinc.h" | |
5561 | -#include "tools.h" | |
5562 | #include "s_user.h" | |
5563 | #include "channel.h" | |
5564 | #include "class.h" | |
5565 | @@ -38,7 +37,6 @@ | |
5566 | #include "listener.h" | |
5567 | #include "msg.h" | |
5568 | #include "numeric.h" | |
5569 | -#include "commio.h" | |
5570 | #include "s_conf.h" | |
5571 | #include "s_newconf.h" | |
5572 | #include "s_log.h" | |
5573 | @@ -48,7 +46,6 @@ | |
5574 | #include "send.h" | |
5575 | #include "supported.h" | |
5576 | #include "whowas.h" | |
5577 | -#include "memory.h" | |
5578 | #include "packet.h" | |
5579 | #include "reject.h" | |
5580 | #include "cache.h" | |
5581 | @@ -264,7 +261,7 @@ | |
5582 | if(rb_dlink_list_length(&source_p->preClient->dnsbl_queries) > 0) | |
5583 | return -1; | |
5584 | ||
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; | |
5589 | ||
5590 | @@ -380,7 +377,7 @@ | |
5591 | if(source_p->localClient->passwd) | |
5592 | { | |
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; | |
5597 | } | |
5598 | } | |
5599 | @@ -676,7 +673,7 @@ | |
5600 | source_p->localClient->passwd); | |
5601 | } | |
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; | |
5606 | } | |
5607 | ||
5608 | @@ -990,7 +987,7 @@ | |
5609 | } | |
5610 | source_p->flags2 &= ~OPER_FLAGS; | |
5611 | ||
5612 | - MyFree(source_p->localClient->opername); | |
5613 | + rb_free(source_p->localClient->opername); | |
5614 | source_p->localClient->opername = NULL; | |
5615 | ||
5616 | rb_dlinkFindDestroy(source_p, &local_oper_list); | |
5617 | @@ -1277,7 +1274,7 @@ | |
5618 | SetExemptKline(source_p); | |
5619 | ||
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); | |
5623 | ||
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 | |
5629 | @@ -32,7 +32,6 @@ | |
5630 | #include "numeric.h" | |
5631 | #include "send.h" | |
5632 | #include "scache.h" | |
5633 | -#include "memory.h" | |
5634 | #include "s_conf.h" | |
5635 | ||
5636 | ||
5637 | @@ -100,13 +99,13 @@ | |
5638 | return ptr; | |
5639 | } | |
5640 | ||
5641 | - ptr = (struct scache_entry *) MyMalloc(sizeof(struct scache_entry)); | |
5642 | + ptr = (struct scache_entry *) rb_malloc(sizeof(struct scache_entry)); | |
5643 | s_assert(0 != ptr); | |
5644 | ||
5645 | strlcpy(ptr->name, name, sizeof(ptr->name)); | |
5646 | ptr->info[0] = '\0'; | |
5647 | ptr->flags = 0; | |
5648 | - ptr->known_since = CurrentTime; | |
5649 | + ptr->known_since = rb_current_time(); | |
5650 | ptr->last_connect = 0; | |
5651 | ptr->last_split = 0; | |
5652 | ||
5653 | @@ -127,7 +126,7 @@ | |
5654 | ptr->flags |= SC_HIDDEN; | |
5655 | else | |
5656 | ptr->flags &= ~SC_HIDDEN; | |
5657 | - ptr->last_connect = CurrentTime; | |
5658 | + ptr->last_connect = rb_current_time(); | |
5659 | return ptr; | |
5660 | } | |
5661 | ||
5662 | @@ -137,7 +136,7 @@ | |
5663 | if (ptr == NULL) | |
5664 | return; | |
5665 | ptr->flags &= ~SC_ONLINE; | |
5666 | - ptr->last_split = CurrentTime; | |
5667 | + ptr->last_split = rb_current_time(); | |
5668 | } | |
5669 | ||
5670 | const char *scache_get_name(struct scache_entry *ptr) | |
5671 | @@ -169,9 +168,9 @@ | |
5672 | !ConfigServerHide.disable_hidden) | |
5673 | show = FALSE; | |
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; | |
5677 | else | |
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; | |
5680 | if (show) | |
5681 | sendto_one_numeric(source_p, RPL_LINKS, form_str(RPL_LINKS), | |
5682 | scache_ptr->name, me.name, 1, scache_ptr->info); | |
5683 | @@ -204,7 +203,7 @@ | |
5684 | scache_ptr = scache_hash[i]; | |
5685 | while (scache_ptr) | |
5686 | { | |
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)", | |
5690 | scache_ptr->name); | |
5691 | ||
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 | |
5695 | @@ -25,7 +25,6 @@ | |
5696 | */ | |
5697 | ||
5698 | #include "stdinc.h" | |
5699 | -#include "tools.h" | |
5700 | #include "send.h" | |
5701 | #include "channel.h" | |
5702 | #include "class.h" | |
5703 | @@ -34,14 +33,11 @@ | |
5704 | #include "irc_string.h" | |
5705 | #include "ircd.h" | |
5706 | #include "numeric.h" | |
5707 | -#include "commio.h" | |
5708 | #include "s_serv.h" | |
5709 | #include "sprintf_irc.h" | |
5710 | #include "s_conf.h" | |
5711 | #include "s_newconf.h" | |
5712 | -#include "linebuf.h" | |
5713 | #include "s_log.h" | |
5714 | -#include "memory.h" | |
5715 | #include "hook.h" | |
5716 | #include "monitor.h" | |
5717 | ||
5718 | @@ -267,7 +263,7 @@ | |
5719 | else | |
5720 | { | |
5721 | to->localClient->slinkq_ofs = 0; | |
5722 | - MyFree(to->localClient->slinkq); | |
5723 | + rb_free(to->localClient->slinkq); | |
5724 | to->localClient->slinkq = NULL; | |
5725 | } | |
5726 | } | |
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 | |
5730 | @@ -34,8 +34,6 @@ | |
5731 | */ | |
5732 | ||
5733 | #include "stdinc.h" | |
5734 | -#include "tools.h" | |
5735 | -#include "balloc.h" | |
5736 | #include "s_user.h" | |
5737 | #include "irc_string.h" | |
5738 | ||
5739 | @@ -59,10 +57,10 @@ | |
5740 | */ | |
5741 | void substitution_append_var(rb_dlink_list *varlist, const char *name, const char *value) | |
5742 | { | |
5743 | - struct substitution_variable *tmp = MyMalloc(sizeof(struct substitution_variable)); | |
5744 | + struct substitution_variable *tmp = rb_malloc(sizeof(struct substitution_variable)); | |
5745 | ||
5746 | - DupString(tmp->name, name); | |
5747 | - DupString(tmp->value, value); | |
5748 | + tmp->name = rb_strdup(name); | |
5749 | + tmp->value = rb_strdup(value); | |
5750 | ||
5751 | rb_dlinkAddAlloc(tmp, varlist); | |
5752 | } | |
5753 | @@ -83,9 +81,9 @@ | |
5754 | struct substitution_variable *tmp = (struct substitution_variable *) nptr->data; | |
5755 | ||
5756 | rb_dlinkDelete(nptr, varlist); | |
5757 | - MyFree(tmp->name); | |
5758 | - MyFree(tmp->value); | |
5759 | - MyFree(tmp); | |
5760 | + rb_free(tmp->name); | |
5761 | + rb_free(tmp->value); | |
5762 | + rb_free(tmp); | |
5763 | } | |
5764 | } | |
5765 | ||
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 | |
5769 | @@ -81,7 +81,6 @@ | |
5770 | */ | |
5771 | ||
5772 | #include "stdinc.h" | |
5773 | -#include "tools.h" | |
5774 | #include "client.h" | |
5775 | #include "common.h" | |
5776 | #include "numeric.h" | |
5777 | @@ -104,7 +103,7 @@ | |
5778 | { | |
5779 | struct isupportitem *item; | |
5780 | ||
5781 | - item = MyMalloc(sizeof(struct isupportitem)); | |
5782 | + item = rb_malloc(sizeof(struct isupportitem)); | |
5783 | item->name = name; | |
5784 | item->func = func; | |
5785 | item->param = param; | |
5786 | @@ -124,7 +123,7 @@ | |
5787 | if (!strcmp(item->name, name)) | |
5788 | { | |
5789 | rb_dlinkDelete(ptr, &isupportlist); | |
5790 | - MyFree(item); | |
5791 | + rb_free(item); | |
5792 | } | |
5793 | } | |
5794 | } | |
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 | |
5798 | @@ -38,7 +38,6 @@ | |
5799 | #include "s_user.h" | |
5800 | #include "send.h" | |
5801 | #include "s_conf.h" | |
5802 | -#include "memory.h" | |
5803 | #include "scache.h" | |
5804 | ||
5805 | /* internally defined function */ | |
5806 | @@ -73,7 +72,7 @@ | |
5807 | del_whowas_from_list(&WHOWASHASH[who->hashv], who); | |
5808 | } | |
5809 | who->hashv = hash_whowas_name(client_p->name); | |
5810 | - who->logoff = CurrentTime; | |
5811 | + who->logoff = rb_current_time(); | |
5812 | /* | |
5813 | * NOTE: strcpy ok here, the sizes in the client struct MUST | |
5814 | * match the sizes in the whowas struct | |
5815 | @@ -119,7 +118,7 @@ | |
5816 | struct Whowas *temp; | |
5817 | int blah; | |
5818 | ||
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) |