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

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

resolv: speed up the termination of loop thread in testing DNS and TLS servers

Use eventfd as a signal to notify the loop thread to terminate. The
loop thread can be terminated right after their stopServer() is called.

Also some minor changes:
[1] Use unique_fd for sockets to avoid fd leakage.
[2] Use ScopedAddrinfo in DnsTlsFrontend to prevent memory unfreed
    if getaddrinfo() fails.
[3] Remove the unnecessary call stopServer() in resolver_test since
    it is automatically called in the their destructor.
[4] Timeout value in the loop thread polling is set as -1 by default.

Before this change: resolv_integration_test takes 145283 ms
After this change: resolv_integration_test takes 125249 ms

Test: runtest and netd_benchmark passed

Change-Id: I97c44ff87c4adfa6242bbd3aa0970474004c16f4
parent 7596d8b3
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