summaryrefslogtreecommitdiff
path: root/src/proxy.c
diff options
context:
space:
mode:
authordane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-23 18:36:58 +0000
committerdane dane@31f1291d-b8d6-0310-a050-a5561fc1590b <dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-08-23 18:36:58 +0000
commit61a23cd017465cd2bff5f037cf54e051a6318b37 (patch)
tree5827cad42b833c88be5783d457ffb03b00c785bf /src/proxy.c
parent26ea4bc11b4e07bbeb95031f2337ff695f83cc16 (diff)
BUILD : 1.7.5 (327) BUGS : none NOTES : Merged anope-capab into main trunk...
git-svn-id: svn://svn.anope.org/anope/trunk@327 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@203 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/proxy.c')
-rw-r--r--src/proxy.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/proxy.c b/src/proxy.c
index 4938c128c..2287031ff 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -48,7 +48,7 @@ SList pxqueue;
pthread_mutex_t queuemut = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t queuecond = PTHREAD_COND_INITIALIZER;
-#if !defined(HAS_NICKIP) && !defined(HAVE_GETHOSTBYNAME_R6) && !defined(HAVE_GETHOSTBYNAME_R5) && !defined(HAVE_GETHOSTBYNAME_R3)
+#if !defined(HAVE_GETHOSTBYNAME_R6) && !defined(HAVE_GETHOSTBYNAME_R5) && !defined(HAVE_GETHOSTBYNAME_R3)
pthread_mutex_t resmut = PTHREAD_MUTEX_INITIALIZER;
#endif
@@ -64,9 +64,7 @@ static void proxy_queue_signal(void);
static void proxy_queue_unlock(void);
static void proxy_queue_wait(void);
static int proxy_read(int s, char *buf, size_t buflen);
-#ifndef HAS_NICKIP
static uint32 proxy_resolve(char *host);
-#endif
static int proxy_scan(uint32 ip);
static void *proxy_thread_main(void *arg);
@@ -126,12 +124,12 @@ void get_proxy_stats(long *nrec, long *memuse)
static void proxy_akill(char *host)
{
- s_akill("*", host, s_OperServ, time(NULL),
- time(NULL) + (ProxyExpire ? ProxyExpire : 86400 * 2),
- ProxyAkillReason);
+ anope_cmd_akill("*", host, s_OperServ, time(NULL),
+ time(NULL) + (ProxyExpire ? ProxyExpire : 86400 * 2),
+ ProxyAkillReason);
if (WallProxy)
- wallops(s_OperServ, "Insecure proxy \2%s\2 has been AKILLed.",
- host);
+ anope_cmd_global(s_OperServ,
+ "Insecure proxy \2%s\2 has been AKILLed.", host);
}
/*************************************************************************/
@@ -173,7 +171,7 @@ static void proxy_cache_del(HostCache * hc)
alog("debug: Deleting %s from host cache", hc->host);
if (hc->status > HC_NORMAL)
- s_rakill("*", hc->host);
+ anope_cmd_remove_akill("*", hc->host);
if (hc->next)
hc->next->prev = hc->prev;
@@ -239,9 +237,9 @@ int proxy_check(char *nick, char *host, uint32 ip)
notice(s_GlobalNoticer, nick, *message);
hc = proxy_cache_add(host);
-#ifdef HAS_NICKIP
- hc->ip = htonl(ip);
-#endif
+ if (ircd->nickip) {
+ hc->ip = htonl(ip);
+ }
hc->status = HC_QUEUED;
proxy_queue_lock();
@@ -439,8 +437,6 @@ static int proxy_read(int s, char *buf, size_t buflen)
/* Resolves hostnames in a thread safe manner */
-#ifndef HAS_NICKIP
-
static uint32 proxy_resolve(char *host)
{
struct hostent *hentp = NULL;
@@ -485,8 +481,6 @@ static uint32 proxy_resolve(char *host)
return ip;
}
-#endif
-
/*************************************************************************/
/* Scans the given host for proxy */
@@ -685,11 +679,11 @@ static void *proxy_thread_main(void *arg)
alog("debug: Scanning host %s for proxy", hc->host);
}
}
-#ifndef HAS_NICKIP
- /* Test if it's an IP, and if not try to resolve the hostname */
- if ((hc->ip = aton(hc->host)) == INADDR_NONE)
- hc->ip = proxy_resolve(hc->host);
-#endif
+ if (!ircd->nickip) {
+ /* Test if it's an IP, and if not try to resolve the hostname */
+ if ((hc->ip = aton(hc->host)) == INADDR_NONE)
+ hc->ip = proxy_resolve(hc->host);
+ }
status = proxy_scan(hc->ip);
if (debug) {