drop only successfully sent packets post sendmmsg
sendmmsg returns with number of packets sent which can be less than number of packets requested to be sent. Do not flush entire write queue and use the returned info to partially clear the write queue. Refs: https://github.com/libuv/libuv/issues/3129 (fixes one issue listed) PR-URL: https://github.com/libuv/libuv/pull/3265 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
This commit is contained in:
parent
04289fa326
commit
6530ea2ff2
@ -375,8 +375,11 @@ write_queue_drain:
|
||||
return;
|
||||
}
|
||||
|
||||
/* Safety: npkts known to be >0 below. Hence cast from ssize_t
|
||||
* to size_t safe.
|
||||
*/
|
||||
for (i = 0, q = QUEUE_HEAD(&handle->write_queue);
|
||||
i < pkts && q != &handle->write_queue;
|
||||
i < (size_t)npkts && q != &handle->write_queue;
|
||||
++i, q = QUEUE_HEAD(&handle->write_queue)) {
|
||||
assert(q != NULL);
|
||||
req = QUEUE_DATA(q, uv_udp_send_t, queue);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user