commit | 084871190e82da9564d229091cc1cd5c7175f4d3 | [log] [tgz] |
---|---|---|
author | Bernie Innocenti <codewiz@google.com> | Fri Oct 11 21:14:13 2019 +0900 |
committer | Bernie Innocenti <codewiz@google.com> | Thu Oct 17 10:06:24 2019 +0000 |
tree | f6157ae38bb36ca445fa9a8a48d5b40a9c8fc11e | |
parent | bf0b3bcc2a2fa0e47c2d9126492a1ba3c2e2fae2 [diff] |
Explicitly allocate ResState on the call stack Previously known as __res_state, res_state, res or even statp, the ResState struct holds the context of a query in progress. After a long series of preparatory patches, the thread-local storage nonsense that's been plaguing this fine codebase for decades is finally gone. Sayonara! ResState is now explicitly allocated on the stack at the beginning of each query and passed down as a regular function argument. To keep this patch reviewable, I threw in two compatibility typedefs for the legacy names. We'll get rid of them in a separate mechanical patch. Next steps: - Give ResState a regular constructor and, crucially, a real destructor - Move the definition to ResState.h, like it's a real class - Populate the nameservers immediately on construction - Switch to safe C++ data structures Change-Id: I5c0b85da3ad9a55fa41dca6c87e57fe8f50c6abc
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.