small changes in Discover() #5273

pull Diapolo wants to merge 2 commits into bitcoin:master from Diapolo:discover-log changing 1 files +5 −5
  1. Diapolo commented at 2:28 PM on November 13, 2014: none
    • Win32: log addresses found in Discover() calls
    • Win32: change buffer size for gethotsname in Discover()
  2. Win32: log addresses found in Discover() calls 8fa0494e92
  3. 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
    cd4d3f1915
  4. sipa commented at 2:44 PM on November 17, 2014: member

    utACK

  5. Diapolo commented at 1:01 PM on November 21, 2014: none

    @laanwj This also contains a string change!

  6. laanwj commented at 1:22 PM on November 21, 2014: member

    @Diapolo No translation string change though?

  7. Diapolo commented at 3:14 PM on November 21, 2014: none

    @laanwj Sorry, that's in #5272.

  8. Diapolo commented at 8:26 AM on November 26, 2014: none

    @laanwj Can we merge this?

  9. 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

  10. laanwj merged this on Nov 26, 2014
  11. laanwj closed this on Nov 26, 2014

  12. laanwj referenced this in commit b031137977 on Nov 26, 2014
  13. Diapolo deleted the branch on Nov 26, 2014
  14. MarcoFalke locked this on Sep 8, 2021
Contributors

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 site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me