Shanks0224 opened a new pull request, #22182: URL: https://github.com/apache/nuttx/pull/22182
*Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary - Add `getaddrinfo_a()`, `gai_suspend()`, `gai_cancel()` and `gai_error()`. - A cancelled lookup thread frees its lookup resources and releases the resolv.conf stream and the DNS lock. - `tls`: keep the cleanup stack balanced on overflow (the lookup thread relies on it). - Fix the failure check of `getaddrinfo()` in `rexec_af()`. - Do not log an error when the hosts file does not exist. ## Impact - New functions only add symbols; the rest are bug fixes. - No impact on the build system, documentation or hardware. ## Testing Build host: Linux x86_64. `sim:nsh` with `CONFIG_NET`, `NET_LOOPBACK`, `NETDB_DNSCLIENT` (name server 127.0.0.1, which never answers, so a lookup blocks until it times out), `CANCELLATION_POINTS` and `TLS_NCLEANUP=4`: - `getaddrinfo_a()`: `GAI_WAIT` with two numeric requests returns the right address and port for each; a failing request reports `EAI_NONAME` through `gai_error()`; `GAI_NOWAIT` completes and is observed with `gai_suspend()` and `gai_error()`. - `gai_cancel()` on a lookup blocked in the DNS query, 10 times: each cancel reports `EAI_CANCELED`, `gai_error()` ends as `EAI_CANCELED`, and the next free file descriptor and the heap usage do not change. - Cancelling a thread blocked in `getaddrinfo()` (an uncancelled lookup blocks for about 35 s), 30 times after a warm-up of 3: - master: 5 file descriptors and 6096 bytes of heap are leaked; - with this PR: none. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
