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

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Trivial - P5 Trivial - P5
    • 1.7.0
    • Affects Version/s: 1.6.3
    • Component/s: network

      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.

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

              Created:
              Updated:
              Resolved: