- Win32: log addresses found in Discover() calls
- Win32: change buffer size for gethotsname in Discover()
small changes in Discover() #5273
pull Diapolo wants to merge 2 commits into bitcoin:master from Diapolo:discover-log changing 1 files +5 −5-
Diapolo commented at 2:28 PM on November 13, 2014: none
-
Win32: log addresses found in Discover() calls 8fa0494e92
-
cd4d3f1915
Win32: change buffer size for gethotsname in Discover()
- 256 byte is the maximum, as per http://msdn.microsoft.com/en-us/library/windows/desktop/ms738527%28v=vs.85%29.aspx
-
sipa commented at 2:44 PM on November 17, 2014: member
utACK
-
in src/net.cpp:None in cd4d3f1915
1558 | @@ -1559,7 +1559,7 @@ void static Discover(boost::thread_group& threadGroup) 1559 | 1560 | #ifdef WIN32 1561 | // Get local host IP 1562 | - char pszHostName[1000] = ""; 1563 | + char pszHostName[256] = "";
laanwj commented at 1:36 PM on November 26, 2014:Just found out why this is enough http://msdn.microsoft.com/en-us/library/windows/desktop/ms738527%28v=vs.85%29.aspx :
The maximum length, in bytes, of the string returned in the buffer pointed to by the name parameter is dependent on the namespace provider, but this string must be 256 bytes or less. So if a buffer of 256 bytes is passed in the name parameter and the namelen parameter is set to 256, the buffer size will always be adequate.
Diapolo commented at 1:41 PM on November 26, 2014:That is mentioned in the commit message :).
laanwj commented at 1:52 PM on November 26, 2014:Hah oops, had only read the github post
laanwj merged this on Nov 26, 2014laanwj closed this on Nov 26, 2014laanwj referenced this in commit b031137977 on Nov 26, 2014Diapolo deleted the branch on Nov 26, 2014MarcoFalke locked this on Sep 8, 2021
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 18:15 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me
More mirrored repositories can be found on mirror.b10c.me