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

_mongoc_buffer_try_append_from_stream() never sets bson_error_t output var

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Trivial - P5 Trivial - P5
    • 1.7.0
    • 1.6.3
    • network

    Description

      Documentation for _mongoc_buffer_try_append_from_stream() states:

       * @error: A location for a bson_error_t, or NULL.
      ...
       * Returns: bytes read if successful; otherwise -1 and @error is set.
      

      However, the error variable is never used within the function. AFAICT, this function is only called from _mongoc_async_cmd_phase_recv_len() and _mongoc_async_cmd_phase_recv_rpc(), both of which set the error struct on their own if _mongoc_buffer_try_append_from_stream() returns 0 or -1.

      It looks like this argument can simply be removed.

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: