Skip to content

Commit

Permalink
credential-cache: handle ECONNREFUSED gracefully
Browse files Browse the repository at this point in the history
In 245670c (credential-cache: check for windows specific errors, 2021-09-14)
we concluded that on Windows we would always encounter ENETDOWN where we
would expect ECONNREFUSED on POSIX systems, when connecting to unix sockets.
As reported in [1], we do sometimes encounter ECONNREFUSED on Windows aswell,
though. we should handle these cases like we do on non-windows systems.

[1] #4762 (comment)

This fixes #5314

Helped-by: M Hickford <mirth.hickford@gmail.com>
Signed-off-by: Matthias Aßhauer <mha1993@live.de>
  • Loading branch information
rimrul committed Dec 22, 2024
1 parent 42a7515 commit ff41d09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin/credential-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static int connection_closed(int error)

static int connection_fatally_broken(int error)
{
return (error != ENOENT) && (error != ENETDOWN);
return (error != ENOENT) && (error != ENETDOWN) && (error != ECONNREFUSED);
}

#else
Expand Down

0 comments on commit ff41d09

Please # to comment.