commit | 166f60b45614dd6e20f6a078e455920672a8a8d5 | [log] [tgz] |
---|---|---|
author | Mike Yu <yumike@google.com> | Mon Jan 17 18:41:41 2022 +0800 |
committer | Mike Yu <yumike@google.com> | Mon Jan 24 09:51:13 2022 +0000 |
tree | 3c60f731f1c8ba764a3608e5a71fd9c5c36b0c46 | |
parent | 995c75fcb1b70581f2bad1f58b4f5d73b65fc113 [diff] |
DoH: Enable session resumption When a connection is closed gracefully, the connection's session will be stored in the `Connection`. The `Network` that owns the `Connection` will attempt to reuse the session on next connection. This change should improve the performance in terms of reducing traffic resources. The example log of a reconnection to dns.google (w/o session resumption): 15:42:47.431 1017 1095 D doh::connection::driver: Sent 1200 bytes on network 100 15:42:47.454 1017 1095 D doh::connection::driver: Received 1200 bytes on network 100 15:42:47.455 1017 1095 D doh::connection::driver: Sent 1200 bytes on network 100 15:42:47.455 1017 1095 D doh::connection::driver: Received 1200 bytes on network 100 15:42:47.456 1017 1095 D doh::connection::driver: Sent 59 bytes on network 100 15:42:47.456 1017 1095 D doh::connection::driver: Received 1200 bytes on network 100 15:42:47.457 1017 1095 D doh::connection::driver: Sent 59 bytes on network 100 15:42:47.458 1017 1095 D doh::connection::driver: Received 1200 bytes on network 100 15:42:47.458 1017 1095 D doh::connection::driver: Sent 59 bytes on network 100 15:42:47.460 1017 1095 D doh::connection::driver: Received 1200 bytes on network 100 15:42:47.461 1017 1095 D doh::connection::driver: Sent 60 bytes on network 100 15:42:47.469 1017 1095 D doh::connection::driver: Received 397 bytes on network 100 15:42:47.469 1017 1095 D doh::connection::driver: Sent 132 bytes on network 100 15:42:47.470 1017 1095 D doh::connection::driver: Handling DNS request on network 100, ... The example log of a reconnection to dns.google (w/ session resumption) 15:33:18.702 1021 1066 D doh::connection::driver: Sent 1200 bytes on network 101 15:33:18.756 1021 1066 D doh::connection::driver: Received 1200 bytes on network 101 15:33:18.757 1021 1066 D doh::connection::driver: Sent 1200 bytes on network 101 15:33:18.758 1021 1066 D doh::connection::driver: Handling DNS request on network 101, ... Bug: 205922811 Test: cd packages/modules/DnsResolver && atest Test: manually tested every non-testing DoH provider listed in mAvailableDoHProviders Change-Id: I5ec02970d03a40a7fea05688e9a42fa50ceb4859
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.