Skip to content

socket_stream: continue to next addrinfo on socket creation failure#4219

Merged
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/socket-stream-addrinfo-loop
Apr 26, 2017
Merged

socket_stream: continue to next addrinfo on socket creation failure#4219
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/socket-stream-addrinfo-loop

Conversation

@pks-t
Copy link
Copy Markdown
Member

@pks-t pks-t commented Apr 26, 2017

When connecting to a remote via socket stream, we first use getaddrinfo
to obtain the possible connection methods followed by creating and
connecting the socket. But when creating the socket, we error out as
soon as we get an invalid socket instead of trying out other address
hints returned by addrinfo.

Fix this by continuing on invalid socket instead of returning an error.
This fixes connection establishment with musl libc.

When connecting to a remote via socket stream, we first use getaddrinfo
to obtain the possible connection methods followed by creating and
connecting the socket. But when creating the socket, we error out as
soon as we get an invalid socket instead of trying out other address
hints returned by addrinfo.

Fix this by continuing on invalid socket instead of returning an error.
This fixes connection establishment with musl libc.
@ethomson
Copy link
Copy Markdown
Member

Neat, thanks!

@ethomson ethomson merged commit 6cf25a3 into libgit2:master Apr 26, 2017
@pks-t pks-t deleted the pks/socket-stream-addrinfo-loop branch April 28, 2017 11:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants