commit | 5d2a10711b6194098a62a309e718117ec93238ca | [log] [tgz] |
---|---|---|
author | Mike Yu <yumike@google.com> | Mon Nov 29 14:57:54 2021 +0800 |
committer | Mike Yu <yumike@google.com> | Fri Dec 03 21:01:57 2021 +0800 |
tree | 37c096229bdc769a0d374e4ad8bf1417e3d600bc | |
parent | 4bdc8678435acac88ea8bd79b06cc9114367b211 [diff] |
DoH: Change Network to use try_send As send() blocks until channel has capacity, Dispatcher gets blocked at sending commands to a Network object if the Network's mpsc channel has no capacity. This happens when there are excess DNS requests while the connection has not been established. Therefore, change all the DoH code to use try_send() that returns an error immediate if the channel is full. If a Network's mpsc channel has no capacity, DNS query threads that called doh_query() with the associated net_id will get DOH_RESULT_CAN_NOT_SEND error immediately. Since it's not a timeout error, they will try DoT. Bug: 207301204 Test: cd packages/modules/DnsResolver && atest Change-Id: I9575e6f410b8b552c07af15284b67b305ecce6b9
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.