aboutsummaryrefslogtreecommitdiff
path: root/core/net
diff options
context:
space:
mode:
authorJeroen van Rijn <Kelimion@users.noreply.github.com>2025-02-23 12:47:22 +0100
committerJeroen van Rijn <Kelimion@users.noreply.github.com>2025-02-23 12:47:22 +0100
commit940da61869f40f6be3051697b63ce375316bb8bf (patch)
treeaaa3b8f687aa0dd96335877b031286eddad1c7b0 /core/net
parentebda946d61d4b7447348afeccd16a6e5786fa91b (diff)
Fix missing error when TCP connection refused.
Fixes #4867
Diffstat (limited to 'core/net')
-rw-r--r--core/net/socket_windows.odin3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/net/socket_windows.odin b/core/net/socket_windows.odin
index 747d5cab3..f19be536a 100644
--- a/core/net/socket_windows.odin
+++ b/core/net/socket_windows.odin
@@ -80,8 +80,9 @@ _dial_tcp_from_endpoint :: proc(endpoint: Endpoint, options := default_tcp_optio
sockaddr := _endpoint_to_sockaddr(endpoint)
res := win.connect(win.SOCKET(socket), &sockaddr, size_of(sockaddr))
if res < 0 {
+ err = Dial_Error(win.WSAGetLastError())
close(socket)
- return {}, Dial_Error(win.WSAGetLastError())
+ return {}, err
}
if options.no_delay {