1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 18:23:14 +02:00

Never understood why it's called get_sockhost() if it actually sets it. Renamed to set_sockhost()

This commit is contained in:
Bram Matthys
2015-07-27 18:30:25 +02:00
parent 55af91a4ce
commit 5bfa5c701e
5 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -203,7 +203,7 @@ extern void reset_help();
extern MODVAR char *debugmode, *configfile, *sbrk0;
extern char *getfield(char *);
extern void get_sockhost(aClient *, char *);
extern void set_sockhost(aClient *, char *);
#ifndef _WIN32
extern char *strerror(int);
#else
+1 -1
View File
@@ -161,7 +161,7 @@ ConfigItem_ban *bconf;
* Perhaps a bit late to do it here, but does anyone care?
*/
if (cptr->local->hostp && cptr->local->hostp->h_name)
get_sockhost(cptr, cptr->local->hostp->h_name);
set_sockhost(cptr, cptr->local->hostp->h_name);
if (link_out)
*link_out = NULL;
+3 -3
View File
@@ -1156,7 +1156,7 @@ add_con_refuse:
report_error("Failed to accept new client %s (could not get ip): %s", acptr);
goto add_con_refuse;
}
get_sockhost(acptr, s);
set_sockhost(acptr, s);
acptr->ip = strdup(s);
/* Tag loopback connections as FLAGS_LOCAL */
@@ -1652,7 +1652,7 @@ int connect_server(ConfigItem_link *aconf, aClient *by, struct hostent *hp)
SetOutgoing(cptr);
IRCstats.unknown++;
list_add(&cptr->lclient_node, &unknown_list);
get_sockhost(cptr, aconf->outgoing.hostname);
set_sockhost(cptr, aconf->outgoing.hostname);
add_client_to_list(cptr);
if (aconf->outgoing.options & CONNECT_SSL)
@@ -1697,7 +1697,7 @@ static struct SOCKADDR *connect_inet(ConfigItem_link *aconf, aClient *cptr, int
}
mysk.SIN_PORT = 0;
get_sockhost(cptr, aconf->outgoing.hostname);
set_sockhost(cptr, aconf->outgoing.hostname);
if (!aconf->outgoing.bind_ip && iConf.link_bindip)
bindip = iConf.link_bindip;
+1 -1
View File
@@ -2783,7 +2783,7 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam
strlcpy(uhost, fullname, sizeof(uhost));
else
strlcpy(uhost, sockhost, sizeof(uhost));
get_sockhost(cptr, uhost);
set_sockhost(cptr, uhost);
#ifdef INET6
is_ipv4 = IN6_IS_ADDR_V4MAPPED(&cptr->local->ip);
#endif /* INET6 */
+2 -3
View File
@@ -379,10 +379,9 @@ char *get_client_host(aClient *cptr)
}
/*
* Form sockhost such that if the host is of form user@host, only the host
* portion is copied.
* Set sockhost to 'host'. Skip the user@ part of 'host' if necessary.
*/
void get_sockhost(aClient *cptr, char *host)
void set_sockhost(aClient *cptr, char *host)
{
char *s;
if ((s = (char *)index(host, '@')))