mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Merge pull request #2929 from divanburger/dial_bug_fix
Fix use of unitialized socket in socket_linux.odin#_dial_tcp_from_endpoint
This commit is contained in:
@@ -143,7 +143,7 @@ _dial_tcp_from_endpoint :: proc(endpoint: Endpoint, options := default_tcp_optio
|
|||||||
reuse_addr: b32 = true
|
reuse_addr: b32 = true
|
||||||
_ = linux.setsockopt(os_sock, linux.SOL_SOCKET, linux.Socket_Option.REUSEADDR, &reuse_addr)
|
_ = linux.setsockopt(os_sock, linux.SOL_SOCKET, linux.Socket_Option.REUSEADDR, &reuse_addr)
|
||||||
addr := _unwrap_os_addr(endpoint)
|
addr := _unwrap_os_addr(endpoint)
|
||||||
errno = linux.connect(linux.Fd(tcp_sock), &addr)
|
errno = linux.connect(linux.Fd(os_sock), &addr)
|
||||||
if errno != .NONE {
|
if errno != .NONE {
|
||||||
return cast(TCP_Socket) os_sock, Dial_Error(errno)
|
return cast(TCP_Socket) os_sock, Dial_Error(errno)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user