Lines Matching refs:a
12 `DnsTlsDispatcher` is a singleton class whose `query` method is the DnsTls's
13 only public interface. `DnsTlsDispatcher` is just a table holding the
14 `DnsTlsTransport` for each server (represented by a `DnsTlsServer` struct) and
15 network. `DnsTlsDispatcher` also blocks each query thread, waiting on a
18 `DnsTlsTransport` sends each query over a `DnsTlsSocket`, opening a
20 `DnsTlsSocket`, which happen on a different thread.
28 `DnsTlsSocket` interleaves all queries onto a single socket, and reports all
38 Classes that spawn a helper thread call `thread::join()` in their destructor to ensure
42 annotations) to minimize the likelihood of a latent threading bug. The unit tests are
45 This code creates O(1) threads per socket, and does not create a new thread for each
46 query or response. However, DnsProxyListener does create a thread for each query.
50 `DnsTlsSocket` can receive queries on any thread, and send them over a
52 The query method writes a struct (containing a pointer to the query) to the pipe
54 reads off the other end of the pipe. The pipe doesn't actually have a queue "inside";
58 We need to pass messages between threads using a pipe, and not a condition variable
59 or a thread-safe queue, because the socket thread has to be blocked
62 threads have to arrive on a socket, so that `poll()` can listen for them.
63 (There can only be a single thread because [you can't use different threads
69 a single socket. To avoid confusion at the server, `DnsTlsQueryMap` assigns each
70 query a new ID for transmission, records the mapping from input IDs to sent IDs, and
82 `DnsTlsSocket` imposes a 20-second inactivity timeout. A socket that has been idle for
84 which could happen as a result of malfunctioning authoritative DNS servers.
87 `DnsTlsQueryMap` imposes a retry limit of 3. `DnsTlsTransport` will retry the query up
89 This limit helps to ensure proper functioning in the case of a recursive resolver that
93 `DnsTlsDispatcher` maintains a 5-minute timeout. Any `DnsTlsTransport` that has had no
94 outstanding queries for 5 minutes will be destroyed at the next query on a different
97 because each `DnsTlsTransport` owns a `DnsTlsSessionCache`. Imposing this timeout
101 `DnsTlsSessionCache` sets a limit of 5 sessions in each cache, expiring the oldest one
116 To make these unit tests possible, this code uses a dependency injection pattern:
117 `DnsTlsSocket` is produced by a `DnsTlsSocketFactory`, and both of these have a
121 which in production is a `DnsTlsSocketFactory`. However, in unit tests, we can
122 substitute a test factory that returns a fake socket, so that the unit tests can
123 run without actually connecting over TLS to a test server. (The integration tests