[CDRIVER-770] Continue writing until all bytes have been written Created: 30/Jul/15  Updated: 19/Oct/16  Resolved: 28/Sep/15

Status: Closed
Project: C Driver
Component/s: libmongoc, network
Affects Version/s: None
Fix Version/s: 1.2-rc0, 1.1.11

Type: Bug Priority: Major - P3
Reporter: Hannes Magnusson Assignee: Hannes Magnusson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to CDRIVER-756 Unchecked errors on failed network wr... Closed

 Description   

In writev_full() we should loop until r == total_bytes, rather then fail right away.

Unless r <= 0 we should resume writing from the r position, so advancing the iovec and quick dancing would be needed.

The expiration also need to be confirmed – if now() is > expire then abort and fail.



 Comments   
Comment by Githook User [ 31/Aug/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-770: Return how much we did write since its OK to return short writes

When we can't finish writing our entire buffered iovec, we must still
return how much we have successfully written so far, in case any of
the previous buffers finished.
Then we can regroup and recalculate from where we left off and retry in
case of an [WSA]EWOULDBLOCK or friends.
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/e863800079f3fdfc0f0abf6f22e098e5fa46ec26

Comment by Githook User [ 31/Aug/15 ]

Author:

{u'username': u'bjori', u'name': u'Hannes Magnusson', u'email': u'bjori@php.net'}

Message: CDRIVER-770: BIO_clear_retry_flags()/BIO_set_retry_read() on the BIO we got, not point to
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/b95d5dfbdd9428129fad749cf5031f2438eac6d2

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