diff options
author | Tom Gundersen <teg@jklm.no> | 2015-11-27 00:42:56 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-11-27 00:42:56 +0100 |
commit | 8a7a7e971e97830fd722fb73ef87f7180180cc27 (patch) | |
tree | 9ac1760894c256185bb5a1899bac69f38b39237c /src/resolve/resolved-dns-scope.c | |
parent | c283267467db7a7fde9d15042b907884118e8fea (diff) | |
parent | 039a8725fdff1d71e9efd28f27741601c5b4235c (diff) |
Merge pull request #2041 from poettering/resolved-various-2
various smaller fixes, plus one that makes the build succeed again
Diffstat (limited to 'src/resolve/resolved-dns-scope.c')
-rw-r--r-- | src/resolve/resolved-dns-scope.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resolve/resolved-dns-scope.c b/src/resolve/resolved-dns-scope.c index 20db1fbd81..fc4ae57ce0 100644 --- a/src/resolve/resolved-dns-scope.c +++ b/src/resolve/resolved-dns-scope.c @@ -70,11 +70,11 @@ int dns_scope_new(Manager *m, DnsScope **ret, Link *l, DnsProtocol protocol, int } static void dns_scope_abort_transactions(DnsScope *s) { - DnsTransaction *t; - assert(s); - while ((t = hashmap_first(s->transactions))) { + while (s->transactions) { + DnsTransaction *t = s->transactions; + /* Abort the transaction, but make sure it is not * freed while we still look at it */ @@ -100,7 +100,7 @@ DnsScope* dns_scope_free(DnsScope *s) { while (s->query_candidates) dns_query_candidate_free(s->query_candidates); - hashmap_free(s->transactions); + hashmap_free(s->transactions_by_key); while ((rr = ordered_hashmap_steal_first(s->conflict_queue))) dns_resource_record_unref(rr); @@ -653,7 +653,7 @@ DnsTransaction *dns_scope_find_transaction(DnsScope *scope, DnsResourceKey *key, /* Try to find an ongoing transaction that is a equal to the * specified question */ - t = hashmap_get(scope->transactions, key); + t = hashmap_get(scope->transactions_by_key, key); if (!t) return NULL; @@ -661,7 +661,7 @@ DnsTransaction *dns_scope_find_transaction(DnsScope *scope, DnsResourceKey *key, * data instead of a real packet, if that's requested. */ if (!cache_ok && IN_SET(t->state, DNS_TRANSACTION_SUCCESS, DNS_TRANSACTION_FAILURE) && - !t->received) + t->answer_source != DNS_TRANSACTION_NETWORK) return NULL; return t; |