23 |
|
*/ |
24 |
|
|
25 |
|
#include "stdinc.h" |
26 |
< |
#include "tools.h" |
26 |
> |
#include "list.h" |
27 |
> |
#include "balloc.h" |
28 |
|
#include "s_conf.h" |
29 |
|
#include "channel.h" |
30 |
|
#include "channel_mode.h" |
31 |
|
#include "client.h" |
32 |
|
#include "common.h" |
33 |
|
#include "handlers.h" |
33 |
– |
#include "list.h" |
34 |
|
#include "modules.h" |
35 |
|
#include "hash.h" |
36 |
|
#include "resv.h" |
418 |
|
return client_p; |
419 |
|
} |
420 |
|
|
421 |
– |
/* |
422 |
– |
* Whats happening in this next loop ? Well, it takes a name like |
423 |
– |
* foo.bar.edu and proceeds to earch for *.edu and then *.bar.edu. |
424 |
– |
* This is for checking full server names against masks although |
425 |
– |
* it isnt often done this way in lieu of using matches(). |
426 |
– |
* |
427 |
– |
* Rewrote to do *.bar.edu first, which is the most likely case, |
428 |
– |
* also made const correct |
429 |
– |
* --Bleep |
430 |
– |
*/ |
431 |
– |
static struct Client * |
432 |
– |
hash_find_masked_server(const char *name) |
433 |
– |
{ |
434 |
– |
char buf[HOSTLEN + 1]; |
435 |
– |
char *p = buf; |
436 |
– |
char *s = NULL; |
437 |
– |
struct Client *server = NULL; |
438 |
– |
|
439 |
– |
if (*name == '*' || *name == '.') |
440 |
– |
return NULL; |
441 |
– |
|
442 |
– |
/* |
443 |
– |
* copy the damn thing and be done with it |
444 |
– |
*/ |
445 |
– |
strlcpy(buf, name, sizeof(buf)); |
446 |
– |
|
447 |
– |
while ((s = strchr(p, '.')) != NULL) |
448 |
– |
{ |
449 |
– |
*--s = '*'; |
450 |
– |
|
451 |
– |
/* Dont need to check IsServer() here since nicknames cant |
452 |
– |
* have *'s in them anyway. |
453 |
– |
*/ |
454 |
– |
if ((server = find_client(s)) != NULL) |
455 |
– |
return server; |
456 |
– |
p = s + 2; |
457 |
– |
} |
458 |
– |
|
459 |
– |
return NULL; |
460 |
– |
} |
461 |
– |
|
421 |
|
struct Client * |
422 |
|
find_server(const char *name) |
423 |
|
{ |
448 |
|
} |
449 |
|
} |
450 |
|
|
451 |
< |
return (client_p != NULL) ? client_p : hash_find_masked_server(name); |
451 |
> |
return client_p; |
452 |
|
} |
453 |
|
|
454 |
|
/* hash_find_channel() |
861 |
|
{ |
862 |
|
if (SecretChannel(chptr) && !IsMember(source_p, chptr)) |
863 |
|
return; |
864 |
< |
if ((unsigned int)dlink_list_length(&chptr->members) < list_task->users_min || |
865 |
< |
(unsigned int)dlink_list_length(&chptr->members) > list_task->users_max || |
864 |
> |
if (dlink_list_length(&chptr->members) < list_task->users_min || |
865 |
> |
dlink_list_length(&chptr->members) > list_task->users_max || |
866 |
|
(chptr->channelts != 0 && |
867 |
|
((unsigned int)chptr->channelts < list_task->created_min || |
868 |
|
(unsigned int)chptr->channelts > list_task->created_max)) || |
900 |
|
|
901 |
|
if (!only_unmasked_channels) |
902 |
|
{ |
903 |
< |
int i; |
903 |
> |
unsigned int i; |
904 |
|
|
905 |
|
for (i = list_task->hash_index; i < HASHSIZE; ++i) |
906 |
|
{ |