Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 166f60b4 authored by Mike Yu's avatar Mike Yu
Browse files

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
parent 995c75fc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment