Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-5957

bson_oid_init may call gethostname before WSAStartup

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Unknown 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 Unassigned
            Reporter:
            ezra.chung@mongodb.com Ezra Chung
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              None
              None
              None
              None