summaryrefslogtreecommitdiff
path: root/src/or/dns.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-02-01 00:37:16 +0000
committerRoger Dingledine <arma@torproject.org>2005-02-01 00:37:16 +0000
commit2e97593d259d4b86f1bc2acca4be7a96895f8633 (patch)
tree80862d2194423d8567e586d970abb73fc356632d /src/or/dns.c
parente7e77d6d8e6bdbd77f74021917d612b514cc8fcf (diff)
downloadtor-2e97593d259d4b86f1bc2acca4be7a96895f8633.tar.gz
tor-2e97593d259d4b86f1bc2acca4be7a96895f8633.zip
define TOR_FRAGILE if you want tor to give you a core when
something goes wrong. this should only be used by people actively tracking bugs. svn:r3487
Diffstat (limited to 'src/or/dns.c')
-rw-r--r--src/or/dns.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/or/dns.c b/src/or/dns.c
index 6d98c89d83..3e862ce692 100644
--- a/src/or/dns.c
+++ b/src/or/dns.c
@@ -118,9 +118,15 @@ static void purge_expired_resolves(uint32_t now) {
log(LOG_DEBUG,"Forgetting old cached resolve (expires %lu)", (unsigned long)resolve->expire);
if (resolve->state == CACHE_STATE_PENDING) {
log_fn(LOG_WARN,"Bug: Expiring a dns resolve that's still pending. Forgot to cull it?");
+#ifdef TOR_FRAGILE
+ tor_assert(0);
+#endif
}
if (resolve->pending_connections) {
log_fn(LOG_WARN, "Closing pending connections on expiring DNS resolve!");
+#ifdef TOR_FRAGILE
+ tor_assert(0);
+#endif
while (resolve->pending_connections) {
pend = resolve->pending_connections;
resolve->pending_connections = pend->next;
@@ -401,6 +407,9 @@ void dns_cancel_pending_resolve(char *address) {
if (!resolve->pending_connections) {
/* XXX this should never trigger, but sometimes it does */
log_fn(LOG_WARN,"Bug: Address '%s' is pending but has no pending connections!", address);
+#ifdef TOR_FRAGILE
+ tor_assert(0);
+#endif
return;
}
tor_assert(resolve->pending_connections);
@@ -596,6 +605,9 @@ int connection_dns_process_inbuf(connection_t *conn) {
if (conn->state != DNSWORKER_STATE_BUSY && buf_datalen(conn->inbuf)) {
log_fn(LOG_WARN,"Bug: read data from an idle dns worker. Please report.");
+#ifdef TOR_FRAGILE
+ tor_assert(0);
+#endif
return 0;
}
if (buf_datalen(conn->inbuf) < 5) /* entire answer available? */