diff options
author | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-05-27 02:24:00 +0000 |
---|---|---|
committer | Robert James Kaes <rjkaes@users.sourceforge.net> | 2001-05-27 02:24:00 +0000 |
commit | 938b7e7f21dfa65f870345f35ccab1756276c37d (patch) | |
tree | 4a818b1addfc9d8259bc9f3963eb5468f82ed2ae /src | |
parent | 23c08ca3ee4e5ab5da5854bd1eb2978c7b817342 (diff) | |
download | tinyproxy-938b7e7f21dfa65f870345f35ccab1756276c37d.tar.gz tinyproxy-938b7e7f21dfa65f870345f35ccab1756276c37d.zip |
Fixed the return type for new_dnscache().
Diffstat (limited to '')
-rw-r--r-- | src/dnscache.c | 8 | ||||
-rw-r--r-- | src/dnscache.h | 5 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/dnscache.c b/src/dnscache.c index 46b5747..8ec3b69 100644 --- a/src/dnscache.c +++ b/src/dnscache.c @@ -1,4 +1,4 @@ -/* $Id: dnscache.c,v 1.8 2001-05-23 18:01:23 rjkaes Exp $ +/* $Id: dnscache.c,v 1.9 2001-05-27 02:24:00 rjkaes Exp $ * * This is a caching DNS system. When a host name is needed we look it up here * and see if there is already an answer for it. The domains are placed in a @@ -43,7 +43,7 @@ struct dnscache_s { static TERNARY dns_tree; -int new_dnscache(void) +TERNARY new_dnscache(void) { dns_tree = ternary_new(); @@ -60,7 +60,7 @@ static int dns_lookup(struct in_addr *addr, char *domain) if (TE_ISERROR(ternary_search(dns_tree, domain, (void *)&ptr))) return -1; - if (difftime(time(NULL), ptr->expire) > DNSEXPIRE) { + if (difftime(time(NULL), ptr->expire) > (double)DNSEXPIRE) { return -1; } @@ -106,7 +106,7 @@ int dnscache(struct in_addr *addr, char *domain) if (!(resolv = gethostbyname(domain))) return -1; - memcpy(addr, resolv->h_addr_list[0], resolv->h_length); + memcpy(addr, resolv->h_addr_list[0], (size_t)resolv->h_length); dns_insert(addr, domain); return 0; diff --git a/src/dnscache.h b/src/dnscache.h index daeafa4..cd85554 100644 --- a/src/dnscache.h +++ b/src/dnscache.h @@ -1,4 +1,4 @@ -/* $Id: dnscache.h,v 1.3 2000-10-23 21:42:31 rjkaes Exp $ +/* $Id: dnscache.h,v 1.4 2001-05-27 02:24:00 rjkaes Exp $ * * See 'dnscache.c' for a detailed description. * @@ -19,8 +19,9 @@ #define _TINYPROXY_DNSCACHE_H_ #include <arpa/inet.h> +#include "ternary.h" -extern int new_dnscache(void); +extern TERNARY new_dnscache(void); extern int dnscache(struct in_addr *addr, char *domain); #endif |