DoH: Send pending data out right after handle a buffered DNS request

After handling a buffered DNS request, the DnsResolver doesn't
send the DoH query out to the server immediatly. Instead, it
starts waiting for any new DNS request or any packets from the
server, which can lead to the DNS request timed out.

So this change makes the DnsResolver send any pending data
immediately after it handles a buffered DNS request.

Bug: 275539642
Test: ran resolv_integration_test.PrivateDnsDohTest#RunOutOfStreams
      2000 times
Change-Id: I4386a929618a251e3b92fe4724fdfe85e0c44bd4
1 file changed
tree: 58506a4b9fe6b71ada63d0d4c72a439819ec7d25
  1. aidl_api/
  2. apex/
  3. binder/
  4. doh/
  5. include/
  6. tests/
  7. .editorconfig
  8. Android.bp
  9. cbindgen.toml
  10. Dns64Configuration.cpp
  11. Dns64Configuration.h
  12. DnsProxyListener.cpp
  13. DnsProxyListener.h
  14. DnsQueryLog.cpp
  15. DnsQueryLog.h
  16. DnsQueryLogTest.cpp
  17. DnsResolver.cpp
  18. DnsResolver.h
  19. DnsResolverService.cpp
  20. DnsResolverService.h
  21. DnsStats.cpp
  22. DnsStats.h
  23. DnsStatsTest.cpp
  24. DnsTlsDispatcher.cpp
  25. DnsTlsDispatcher.h
  26. DnsTlsQueryMap.cpp
  27. DnsTlsQueryMap.h
  28. DnsTlsServer.cpp
  29. DnsTlsServer.h
  30. DnsTlsSessionCache.cpp
  31. DnsTlsSessionCache.h
  32. DnsTlsSocket.cpp
  33. DnsTlsSocket.h
  34. DnsTlsSocketFactory.h
  35. DnsTlsTransport.cpp
  36. DnsTlsTransport.h
  37. doh.h
  38. Experiments.cpp
  39. Experiments.h
  40. ExperimentsTest.cpp
  41. getaddrinfo.cpp
  42. getaddrinfo.h
  43. gethnamaddr.cpp
  44. gethnamaddr.h
  45. hostent.h
  46. IDnsTlsSocket.h
  47. IDnsTlsSocketFactory.h
  48. IDnsTlsSocketObserver.h
  49. libnetd_resolv.map.txt
  50. LockedQueue.h
  51. NOTICE
  52. OperationLimiter.h
  53. OperationLimiterTest.cpp
  54. OWNERS
  55. params.h
  56. PREUPLOAD.cfg
  57. PrivateDnsCommon.h
  58. PrivateDnsConfiguration.cpp
  59. PrivateDnsConfiguration.h
  60. PrivateDnsConfigurationTest.cpp
  61. PrivateDnsValidationObserver.h
  62. README-DoT.md
  63. README.md
  64. res_cache.cpp
  65. res_comp.cpp
  66. res_comp.h
  67. res_debug.cpp
  68. res_debug.h
  69. res_mkquery.cpp
  70. res_query.cpp
  71. res_send.cpp
  72. res_send.h
  73. res_stats.cpp
  74. resolv_cache.h
  75. resolv_private.h
  76. resolv_test_config_template.xml
  77. resolv_test_config_without_root_template.xml
  78. ResolverController.cpp
  79. ResolverController.h
  80. ResolverEventReporter.cpp
  81. ResolverEventReporter.h
  82. ResolverStats.h
  83. sethostent.cpp
  84. stats.h
  85. stats.proto
  86. TEST_MAPPING
  87. util.cpp
  88. util.h
README.md

Logging

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.