]> git.ipfire.org Git - thirdparty/systemd.git/commit
resolved: use reference counting for DnsQueryCandidate objects 18407/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Jan 2021 15:21:08 +0000 (16:21 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 29 Jan 2021 16:14:15 +0000 (17:14 +0100)
commit0e0fd08fc832b8f42e567d722d388eba086da5ff
treeee5c9d9bd6d0faba89fc514b4bb72bcb4c18ccb9
parentc805014a350da7c32eb2bdb408a9fa643c191dee
resolved: use reference counting for DnsQueryCandidate objects

Follow-up for 4ea8b443de. The logic that manages DnsQueryCandidate is rather
complicated: a calls to dns_query_complete() that wants to destroy a
DnsQueryCandidate can be nested inside a deep chain of calls. Using reference
counts seems like the simplest approach.

DnsSearchDomain already uses reference counting.

This patch effectively brings dns_query_candidate_go() to the state before
4ea8b443de, but wraps the iteration over DnsQueryCandidate.transactions in
dns_query_candidate_ref+dns_query_candidate_unref.
src/resolve/resolved-dns-query.c
src/resolve/resolved-dns-query.h
src/resolve/resolved-dns-scope.c