commit | dfbcdde55ae5d92e389bf2f7fceb7d29f30c3cdc | [log] [tgz] |
---|---|---|
author | Mike Yu <yumike@google.com> | Thu Feb 10 16:43:47 2022 +0800 |
committer | Mike Yu <yumike@google.com> | Wed Feb 23 15:47:02 2022 +0800 |
tree | 5dbd5574ffdca7dd751e504178f5c8d2a03d2fc1 | |
parent | f4fa285df0f02115b83e82247aaab39c7462f4e3 [diff] |
DoH: Handle connection draining state When a CONNECTION_CLOSE frame is received, the connection enters draining state (RFC 9000 section 10.2.2). When in draining state, no more packets can be sent. So the DoH client needs to initiate a new connection if necessary; otherwise, subsequent DNS requests might fail. As a connection enters draining state upon a CONNECTION_CLOSE frame is received, DNS packets sent prior to the frame received might fail. For example, in Quiche (version 0.9.0) implementation, the DoH client can send some DNS packets out on the same connection after predefined max_idle_timeout seconds (55 seconds) because of large Probe Timeout (RFC 9002 section 6.2). It might lead to the DoH server responding with a CONNECTION_CLOSE frame, and result in those DNS queries failed. Bug: 215818810 Test: cd packages/modules/DnsResolver && atest Test: manual test (see bug 215818810 comment#2) verified that the DoH client can create a new connection for subsequent DNS requests after detecting a connection being draining state. Change-Id: Ibd1667aeb9e1528776392e6f91ddb13b66637f33
This code uses LOG(X) for logging. Log levels are VERBOSE,DEBUG,INFO,WARNING and ERROR. The default setting is WARNING and logs relate to WARNING and ERROR will be shown. If you want to enable the DEBUG level logs, using following command. adb shell service call dnsresolver 10 i32 1 VERBOSE 0 DEBUG 1 INFO 2 WARNING 3 ERROR 4 Verbose resolver logs could contain PII -- do NOT enable in production builds.