[all-commits] [llvm/llvm-project] d5ba14: [lldb] Correct an issue when using Socket to liste...
John Harrison via All-commits
all-commits at lists.llvm.org
Wed Dec 4 08:47:40 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d5ba143a6d8e8726c900dbfc381dab0e7d8b6a65
https://github.com/llvm/llvm-project/commit/d5ba143a6d8e8726c900dbfc381dab0e7d8b6a65
Author: John Harrison <harjohn at google.com>
Date: 2024-12-04 (Wed, 04 Dec 2024)
Changed paths:
M lldb/source/Host/common/TCPSocket.cpp
M lldb/unittests/Host/SocketTest.cpp
Log Message:
-----------
[lldb] Correct an issue when using Socket to listen on `localhost:0` on ipv4 and ipv6. (#118565)
On systems supporting ting ipv4 and ipv6 the second socket to initialize
will not update the listening address correctly after the call to `bind`.
This results in the second address listed in
`Socket::GetListeningConnectionURI` to have port `:0`, which is
incorrect.
To fix this, correct which address is used to detect the port and update
the unit tests to cover this use case.
Additionally, I updated the SocketTest's to only parameterize tests that
can work on ipv4 or ipv6. This means tests like
`SocketTest::DecodeHostAndPort` are only run once, instead of twice
since they do not change behavior based on parameters.
I also included a new unit test to cover listening on `localhost:0`,
validating both sockets correctly list the updated port.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list