bson_oid_init may call gethostname before WSAStartup

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • C Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Investigate how to address the issue of gethostname potentially being invoked by bson_oid_init (when initializing a default context) before WSAStartup has been invoked by mongoc_init, as is required by the WinSock library on Windows (e.g. when using the bson library without mongoc).

      This bug produces the following stderr message on Windows (e.g. by the C++ Driver's test_bson binary):

      unable to get hostname: 0
      

      Note: the value of 0 is due to printing errno instead of WSAGetLastError.

              Assignee:
              Unassigned
              Reporter:
              Ezra Chung
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: