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

Audit documentation to make it clear that reply bson_t's should be stack-allocated

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.26.0
    • Affects Version/s: None
    • Component/s: docs, Docs Examples
    • Labels:
      None

      Background & Motivation

      C driver API which accepts a bson_t* reply expects the reply to be uninitialized. This is inconsistently documented.

      mongoc_collection_command_simple notes:

      reply: A location to initialize a bson_t. This should be on the stack.

      mongoc_database_command_simple notes:

      reply: A location to store the commands first result document.

      mongoc_client_session_commit_transaction notes:

      reply: An optional uninitialized bson_t to receive the server reply, or NULL.

      Scope
      Audit the documentation for all API methods that take a bson_t* reply and consistently document that the reply must be uninitialized and cannot be the pointer returned by bson_new.

            Assignee:
            adrian.dole@mongodb.com Adrian Dole
            Reporter:
            samantha.ritter@mongodb.com Samantha Ritter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: