X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/8db00894ab7750513d8750290e508b5802bc1fc5..8fa2ba9c88ead44cb1ef981e6337a4c6880a58ef:/src/hash.c diff --git a/src/hash.c b/src/hash.c index ccc74d6..5386856 100644 --- a/src/hash.c +++ b/src/hash.c @@ -31,7 +31,7 @@ #include "client.h" #include "common.h" #include "hash.h" -#include "irc_string.h" +#include "match.h" #include "ircd.h" #include "numeric.h" #include "send.h" @@ -632,7 +632,7 @@ hash_find_resv(const char *name) { aconf = ptr->data; - if(!irccmp(name, aconf->name)) + if(!irccmp(name, aconf->host)) { aconf->port++; return aconf; @@ -664,35 +664,35 @@ clear_resv_hash(void) HASH_WALK_END } -void -add_to_cli_fd_hash(struct Client *client_p) -{ - rb_dlinkAddAlloc(client_p, &clientbyfdTable[hash_cli_fd(rb_get_fd(client_p->localClient->F))]); -} - - -void -del_from_cli_fd_hash(struct Client *client_p) -{ - unsigned int hashv; - hashv = hash_cli_fd(rb_get_fd(client_p->localClient->F)); - rb_dlinkFindDestroy(client_p, &clientbyfdTable[hashv]); -} - -struct Client * -find_cli_fd_hash(int fd) -{ - struct Client *target_p; - rb_dlink_node *ptr; - unsigned int hashv; - hashv = hash_cli_fd(fd); - RB_DLINK_FOREACH(ptr, clientbyfdTable[hashv].head) - { - target_p = ptr->data; - if(rb_get_fd(target_p->localClient->F) == fd) - return target_p; - } - return NULL; +void +add_to_cli_fd_hash(struct Client *client_p) +{ + rb_dlinkAddAlloc(client_p, &clientbyfdTable[hash_cli_fd(rb_get_fd(client_p->localClient->F))]); +} + + +void +del_from_cli_fd_hash(struct Client *client_p) +{ + unsigned int hashv; + hashv = hash_cli_fd(rb_get_fd(client_p->localClient->F)); + rb_dlinkFindDestroy(client_p, &clientbyfdTable[hashv]); +} + +struct Client * +find_cli_fd_hash(int fd) +{ + struct Client *target_p; + rb_dlink_node *ptr; + unsigned int hashv; + hashv = hash_cli_fd(fd); + RB_DLINK_FOREACH(ptr, clientbyfdTable[hashv].head) + { + target_p = ptr->data; + if(rb_get_fd(target_p->localClient->F) == fd) + return target_p; + } + return NULL; } static void