Skip to content

happy-eyeballs: Report the getaddrinfo error for a failed lookup - #918

Merged
zackees merged 2 commits into
masterfrom
fix/903-happy-eyeballs-gai-error
Oct 15, 2026
Merged

zackees merged 2 commits into
masterfrom
fix/903-happy-eyeballs-gai-error

Conversation

@zackees

@zackees zackees commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

Fixes #903.

RED (test: A failed happy-eyeballs name lookup reports its own error): new test/cmocka/test_happy_eyeballs_gai_error.c resolves an .invalid host and expects a non-zero error code and a message other than "Success". Expected to fail on Linux, where the error code is 0 and the message "Success" (seen in the #880 characterization run); PR CI shows the RED run.

GREEN (happy-eyeballs: Report the getaddrinfo error for a failed lookup): store getaddrinfo's result and its gai_strerror text (gai_strerrorA on Windows, the narrow form under UNICODE). The new define sits in the existing #ifdef _WIN32 block: the file's platform-conditional count stays 8, so the #848 ratchet is unaffected.

Local: cc -fsyntax-only -std=gnu11 -Wall -Werror ok; ./lint ok. Tier 2 OFF: test_happy_eyeballs_gai_error and test_rtmp_dbr_user_bitrate (also links happy-eyeballs) pass. Two unrelated tests failed in that run, test_async_delay_audio (real-time audio, #838) and test_v4l2_busy_signal (a forced camera holder not yet reaped); the harness stops there, so the ON build was not run locally. PR CI runs both.

test_happy_eyeballs_gai_error resolves an .invalid host and expects a
non-zero error code and a message other than "Success". On Linux the
connector stores errno instead of getaddrinfo's result, so both fail.

Refs #903
build_addr_list stored GetSockError() (errno / WSAGetLastError()) and
its strerror when getaddrinfo failed, but getaddrinfo reports through
its result: on Linux the error code was 0 and the message "Success".
Store the result and its gai_strerror text (gai_strerrorA on Windows,
the narrow form under UNICODE). The new define sits in the existing
platform block, so no platform conditional is added.

Fixes #903
@zackees

zackees commented Oct 15, 2026

Copy link
Copy Markdown
Member Author

RED confirmed in PR CI (run 38818130531, Rust Tier 2 Linux): test_happy_eyeballs_gai_error failed with 0 == 0 at test_happy_eyeballs_gai_error.c:47, the error-code assertion: a failed lookup reported error 0 on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

bug: shared/happy-eyeballs: a failed name lookup reports errno instead of the getaddrinfo error (error code 0 on Linux)

1 participant