[CDRIVER-2173] _mongoc_buffer_try_append_from_stream() never sets bson_error_t output var Created: 01/Jun/17  Updated: 28/Oct/23  Resolved: 30/Jun/17

Status: Closed
Project: C Driver
Component/s: network
Affects Version/s: 1.6.3
Fix Version/s: 1.7.0

Type: Improvement Priority: Trivial - P5
Reporter: Jeremy Mikola Assignee: A. Jesse Jiryu Davis
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 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.



 Comments   
Comment by Githook User [ 30/Jun/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-2173 unused argument
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/d573130858a9252df958d2e688936814da4c12f7

Generated at Wed Feb 07 21:14:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.