net: Improve and document SOCKS code #11397

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2017_09_socks_refactor changing 1 files +89 −36
  1. laanwj commented at 9:59 AM on September 25, 2017: member

    Make the SOCKS code more consistent, and document the constants used.

  2. laanwj added the label P2P on Sep 25, 2017
  3. laanwj added the label Refactoring on Sep 25, 2017
  4. laanwj force-pushed on Sep 25, 2017
  5. in src/netbase.cpp:256 in 0f92fb279e outdated
     253 |      // Maximum time to wait in one select call. It will take up until this time (in millis)
     254 |      // to break off in case of an interruption.
     255 |      const int64_t maxWait = 1000;
     256 |      while (len > 0 && curTime < endTime) {
     257 | -        ssize_t ret = recv(hSocket, data, len, 0); // Optimistically try the recv first
     258 | +        ssize_t ret = recv(hSocket, (void*)data, len, 0); // Optimistically try the recv first
    


    promag commented at 3:01 PM on September 25, 2017:

    Funny, in windows 2nd arg is char*, that's why the build failed.


    laanwj commented at 3:17 PM on September 25, 2017:

    Oops, thought it would be void, added the wrong cast. Should be ok now.

  6. laanwj force-pushed on Sep 25, 2017
  7. theuni commented at 4:42 PM on September 25, 2017: member

    utACK 46544c60d67d8a7095e7243795d2b570ab8391e3. InterruptibleRecv goes away soon as part of the async connection work, but having the SOCKS constants defined will make those changes much easier to review. Thanks for saving me a step :)

  8. promag commented at 4:52 PM on September 25, 2017: member

    utACK 46544c6.

  9. in src/netbase.cpp:217 in 46544c60d6 outdated
     212 | +    NOTALLOWED = 0x02,      //! Connection not allowed by ruleset
     213 | +    NETUNREACHABLE = 0x03,  //! Network unreachable
     214 | +    HOSTUNREACHABLE = 0x04, //! Network unreachable
     215 | +    CONNREFUSED = 0x05,     //! Connection refused
     216 | +    TTLEXPIRED = 0x06,      //! TTL expired
     217 | +    CMDUNSUPPORTED = 0x07,  //! Command not supported
    


    promag commented at 4:54 PM on September 25, 2017:

    Nit, align this and above comments with below.

  10. gmaxwell approved
  11. gmaxwell commented at 7:36 PM on September 25, 2017: contributor

    ACK

  12. net: Improve and document SOCKS code
    Make the SOCKS code more consistent, and document the constants used.
    22f816ef4d
  13. laanwj commented at 2:00 PM on September 26, 2017: member

    Re-aligned comment @promag nit 46544c622f816ef4dd57785627d801c247714cace7fc5b5

  14. laanwj force-pushed on Sep 26, 2017
  15. gmaxwell approved
  16. gmaxwell commented at 6:28 PM on September 27, 2017: contributor

    reACK

  17. sipa commented at 6:34 PM on September 27, 2017: member

    utACK 22f816ef4dd57785627d801c247714cace7fc5b5

  18. TheBlueMatt commented at 7:16 PM on September 27, 2017: member

    utACK 22f816ef4dd57785627d801c247714cace7fc5b5

  19. jonasschnelli commented at 3:03 AM on September 28, 2017: contributor

    utACK 22f816ef4dd57785627d801c247714cace7fc5b5

  20. jonasschnelli commented at 3:09 AM on September 28, 2017: contributor

    Tested ACK (macOS 10.12) 22f816ef4dd57785627d801c247714cace7fc5b5.

  21. jonasschnelli merged this on Sep 28, 2017
  22. jonasschnelli closed this on Sep 28, 2017

  23. jonasschnelli referenced this in commit d90a00eabe on Sep 28, 2017
  24. MarcoFalke referenced this in commit 27e861a9b3 on Oct 9, 2017
  25. codablock referenced this in commit 1313ee3d46 on Sep 25, 2019
  26. ebfull referenced this in commit c3b53fa2e8 on Nov 8, 2019
  27. ebfull referenced this in commit 812d0ac44b on Nov 8, 2019
  28. cronicc referenced this in commit ce5818b8c1 on Nov 8, 2019
  29. milesmanley referenced this in commit a437b46e69 on Nov 8, 2019
  30. ca333 referenced this in commit b429cee302 on Nov 9, 2019
  31. denverbdr referenced this in commit 5f5544dfd1 on Nov 9, 2019
  32. codablock referenced this in commit 9e7908063e on Nov 18, 2019
  33. codablock referenced this in commit 36473015b6 on Nov 19, 2019
  34. milesmanley referenced this in commit 196ad00412 on Nov 23, 2019
  35. MIPPL referenced this in commit 25d33a412b on Nov 24, 2019
  36. Asherda referenced this in commit 6f66f879dd on Nov 30, 2019
  37. Asherda referenced this in commit a5c1645c6b on Nov 30, 2019
  38. CryptoForge referenced this in commit 79779934a1 on Dec 3, 2019
  39. cryptobubbles referenced this in commit 327e39f99e on Dec 6, 2019
  40. cryptobubbles referenced this in commit aad398c0d3 on Dec 7, 2019
  41. hTrap referenced this in commit 37d19dbb52 on Dec 8, 2019
  42. cryptobubbles referenced this in commit 82448c8534 on Dec 8, 2019
  43. cryptoprofutonium referenced this in commit 15975c0904 on Dec 8, 2019
  44. cryptoprofutonium referenced this in commit 3bf607c4f4 on Dec 8, 2019
  45. cryptobubbles referenced this in commit f42d6f10be on Dec 8, 2019
  46. hTrap referenced this in commit 017aa16bf5 on Dec 8, 2019
  47. barrystyle referenced this in commit 3ea5edc704 on Jan 22, 2020
  48. cronicc referenced this in commit a9f78af0b0 on Feb 10, 2020
  49. random-zebra referenced this in commit 3c6076835a on Feb 1, 2021
  50. ckti referenced this in commit d99447fcea on Mar 28, 2021
  51. DrahtBot 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-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me