_mongoc_buffer_try_append_from_stream() never sets bson_error_t output var

XMLWordPrintableJSON

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

      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:
              A. Jesse Jiryu Davis
              Reporter:
              Jeremy Mikola
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: