mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-31 02:12:11 +00:00
In other places where `getsockname` is called, the size of the 'name' is used.d573578b28/lib/pure/nativesockets.nim (L347-L351)d573578b28/lib/pure/nativesockets.nim (L585-L595)d573578b28/lib/pure/nativesockets.nim (L622-L624)d573578b28/lib/pure/nativesockets.nim (L347-L350)I have checked the [Windows documentation](https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-getsockname#remarks), and it describes it like this: "On call, the namelen parameter contains the size of the name buffer, in bytes. On return, the namelen parameter contains the actual size in bytes of the name parameter." [https://www.man7.org/linux/man-pages/man2/getsockname.2.html](https://www.man7.org/linux/man-pages/man2/getsockname.2.html) say: The addrlen argument should be initialized to indicate the amount of space (in bytes) pointed to by addr. (cherry picked from commit8e36fb0fec)