Skip to content

Commit

Permalink
Show correct address for ipv6 sockets, fixes nim-lang#7634 (nim-lang#…
Browse files Browse the repository at this point in the history
  • Loading branch information
LemonBoy authored and narimiran committed Jan 31, 2019
1 parent abcd9fd commit 81e5a35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/pure/net.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ proc recvFrom*(socket: Socket, data: var string, length: int,

if result != -1:
data.setLen(result)
address = $inet_ntoa(sockAddress.sin_addr)
address = getAddrString(cast[ptr SockAddr](addr(sockAddress)))
port = ntohs(sockAddress.sin_port).Port
else:
raiseOSError(osLastError())
Expand Down
2 changes: 1 addition & 1 deletion lib/windows/winlean.nim
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@ proc getProcessTimes*(hProcess: Handle; lpCreationTime, lpExitTime,
dynlib: "kernel32", importc: "GetProcessTimes".}

type inet_ntop_proc = proc(family: cint, paddr: pointer, pStringBuffer: cstring,
stringBufSize: int32): cstring {.gcsafe, stdcall.}
stringBufSize: int32): cstring {.gcsafe, stdcall, tags: [].}

var inet_ntop_real: inet_ntop_proc = nil

Expand Down

0 comments on commit 81e5a35

Please sign in to comment.