Simplify hunt_server(), send ERR_NOSUCHSERVER from only one place.
This commit is contained in:
parent
88192c68aa
commit
f8283571ad
26
src/s_serv.c
26
src/s_serv.c
|
@ -156,20 +156,8 @@ 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)
|
||||
{
|
||||
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))
|
||||
|
@ -179,18 +167,12 @@ hunt_server(struct Client *client_p, struct Client *source_p,
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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