Simplify hunt_server(), send ERR_NOSUCHSERVER from only one place.
This commit is contained in:
parent
88192c68aa
commit
f8283571ad
34
src/s_serv.c
34
src/s_serv.c
|
@ -156,41 +156,23 @@ hunt_server(struct Client *client_p, struct Client *source_p,
|
|||
* Again, if there are no wild cards involved in the server
|
||||
* name, use the hash lookup
|
||||
*/
|
||||
if(!target_p)
|
||||
if(!target_p && wilds)
|
||||
{
|
||||
if(!wilds)
|
||||
RB_DLINK_FOREACH(ptr, global_client_list.head)
|
||||
{
|
||||
if(MyClient(source_p) || !IsDigit(parv[server][0]))
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
|
||||
form_str(ERR_NOSUCHSERVER),
|
||||
parv[server]);
|
||||
return (HUNTED_NOSUCH);
|
||||
}
|
||||
else
|
||||
{
|
||||
target_p = NULL;
|
||||
|
||||
RB_DLINK_FOREACH(ptr, global_client_list.head)
|
||||
if(match(new, ((struct Client *) (ptr->data))->name))
|
||||
{
|
||||
if(match(new, ((struct Client *) (ptr->data))->name))
|
||||
{
|
||||
target_p = ptr->data;
|
||||
break;
|
||||
}
|
||||
target_p = ptr->data;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(target_p && !IsRegistered(target_p))
|
||||
target_p = NULL;
|
||||
|
||||
if(target_p)
|
||||
{
|
||||
if(!IsRegistered(target_p))
|
||||
{
|
||||
sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
|
||||
form_str(ERR_NOSUCHSERVER),
|
||||
parv[server]);
|
||||
return HUNTED_NOSUCH;
|
||||
}
|
||||
|
||||
if(IsMe(target_p) || MyClient(target_p))
|
||||
return HUNTED_ISME;
|
||||
|
||||
|
|
Loading…
Reference in New Issue