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() |