aboutsummaryrefslogtreecommitdiff
path: root/libevent-2.0.20-stable
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2015-05-15 10:25:14 +0200
committerBjørn Mork <bjorn@mork.no>2015-05-15 10:25:14 +0200
commitc9c35747c0d20cff54561c0b8fe15813c7a8e0ff (patch)
tree206501a10c9f394cce59ce2eec9c25f5a911a783 /libevent-2.0.20-stable
parentbb2d4d31e2dab11025ae93ebcebc818c36a9747f (diff)
ripe-atlas-fw: imported version 45704570
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'libevent-2.0.20-stable')
-rw-r--r--libevent-2.0.20-stable/evdns.c22
-rw-r--r--libevent-2.0.20-stable/evutil.c6
-rw-r--r--libevent-2.0.20-stable/include/event2/util.h3
3 files changed, 28 insertions, 3 deletions
diff --git a/libevent-2.0.20-stable/evdns.c b/libevent-2.0.20-stable/evdns.c
index 8beee70..cf38418 100644
--- a/libevent-2.0.20-stable/evdns.c
+++ b/libevent-2.0.20-stable/evdns.c
@@ -4054,6 +4054,13 @@ evdns_base_parse_hosts_line(struct evdns_base *base, char *line)
memcpy(he->hostname, hostname, namelen+1);
he->addrlen = socklen;
+#if 0
+ fprintf(stderr, "evdns_base_parse_hosts_line: base %p, he %p\n",
+ base, he);
+ fprintf(stderr,
+ "evdns_base_parse_hosts_line: tqh_first %p, tqh_last %p\n",
+ base->hostsdb.tqh_first, base->hostsdb.tqh_last);
+#endif
TAILQ_INSERT_TAIL(&base->hostsdb, he, next);
if (hash)
@@ -4073,6 +4080,15 @@ evdns_base_load_hosts_impl(struct evdns_base *base, const char *hosts_fname)
ASSERT_LOCKED(base);
+ {
+ struct hosts_entry *victim;
+ while ((victim = TAILQ_FIRST(&base->hostsdb))) {
+ TAILQ_REMOVE(&base->hostsdb, victim, next);
+ mm_free(victim);
+ }
+ }
+
+
if (hosts_fname == NULL ||
(err = evutil_read_file(hosts_fname, &str, &len, 0)) < 0) {
char tmp[64];
@@ -4167,7 +4183,7 @@ evdns_err_to_getaddrinfo_err(int e1)
else if (e1 == DNS_ERR_NOTEXIST)
return EVUTIL_EAI_NONAME;
else
- return EVUTIL_EAI_FAIL;
+ return EVUTIL_EAI_FAIL_1;
}
/* Return the more informative of two getaddrinfo errors. */
@@ -4529,7 +4545,7 @@ evdns_getaddrinfo(struct evdns_base *dns_base,
log(EVDNS_LOG_WARN,
"Call to getaddrinfo_async with no "
"evdns_base configured.");
- cb(EVUTIL_EAI_FAIL, NULL, arg); /* ??? better error? */
+ cb(EVUTIL_EAI_FAIL_2, NULL, arg); /* ??? better error? */
return NULL;
}
}
@@ -4630,7 +4646,7 @@ evdns_getaddrinfo(struct evdns_base *dns_base,
return data;
} else {
mm_free(data);
- cb(EVUTIL_EAI_FAIL, NULL, arg);
+ cb(EVUTIL_EAI_FAIL_3, NULL, arg);
return NULL;
}
}
diff --git a/libevent-2.0.20-stable/evutil.c b/libevent-2.0.20-stable/evutil.c
index e17e5b8..b07319a 100644
--- a/libevent-2.0.20-stable/evutil.c
+++ b/libevent-2.0.20-stable/evutil.c
@@ -1443,6 +1443,12 @@ evutil_gai_strerror(int err)
return "invalid value for ai_flags";
case EVUTIL_EAI_FAIL:
return "non-recoverable failure in name resolution";
+ case EVUTIL_EAI_FAIL_1:
+ return "non-recoverable failure in name resolution (1)";
+ case EVUTIL_EAI_FAIL_2:
+ return "non-recoverable failure in name resolution (2)";
+ case EVUTIL_EAI_FAIL_3:
+ return "non-recoverable failure in name resolution (3)";
case EVUTIL_EAI_FAMILY:
return "ai_family not supported";
case EVUTIL_EAI_MEMORY:
diff --git a/libevent-2.0.20-stable/include/event2/util.h b/libevent-2.0.20-stable/include/event2/util.h
index 4b7e8b4..adc3ce5 100644
--- a/libevent-2.0.20-stable/include/event2/util.h
+++ b/libevent-2.0.20-stable/include/event2/util.h
@@ -548,6 +548,9 @@ struct evutil_addrinfo {
#else
#define EVUTIL_EAI_FAIL -904
#endif
+#define EVUTIL_EAI_FAIL_1 -921
+#define EVUTIL_EAI_FAIL_2 -922
+#define EVUTIL_EAI_FAIL_3 -923
#ifdef EAI_FAMILY
#define EVUTIL_EAI_FAMILY EAI_FAMILY
#else