forked from PowerDNS/pdns
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dnsdist: Get rid of TCPCrossProtocolQuerySender
We need this construct to deal with cross-protocol queries, like queries received over TCP or DoT, but forwarded over DoH, because the thread dealing with the client and the one dealing with the backend will not be the same in that case, and we do not want to have different threads touching the same TCP connections. So we pass the query and response to the correct thread via pipes. Until now we were allocating an additional object, TCPCrossProtocolQuerySender, to deal with that case, but I noticed that the existing IncomingTCPConnectionState object already does everything we need, except that it needs to know that the response is a cross-protocol one in order to pass it via the pipe instead of treating it in a different way. This can be done by looking if the current thread ID differs from the one that created this object: if it does, we are dealing with a cross-protocol response and should pass it via the pipe, and if it does not we can deal with it directly. This change saves the need to allocate a new object wrapped in a shared pointer for each cross-protocol query, which is quite nice.
- Loading branch information
Showing
3 changed files
with
39 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters