Branch: refs/heads/calm-down-recvmmsg-on-eof
Home: https://github.com/kronosnet/kronosnet
Commit: 457f959d8bc0af521cb15050c6a4347f5728aa4e
https://github.com/kronosnet/kronosnet/commit/457f959d8bc0af521cb15050c6a43…
Author: Christine Caulfield <ccaulfie(a)redhat.com>
Date: 2020-01-16 (Thu, 16 Jan 2020)
Changed paths:
M libknet/transport_common.c
M libknet/transport_sctp.c
Log Message:
-----------
[rx] Don't return 512 EOF messagese from _recvmmsg
If recvmsg() returns 0 for EOF then it's going to do so
until the error is rectified or read with getsockopt(). But
the _recvmmsg() wrapper keeps reading until the vector is full
thus returning a block of 512 EOF messages all of which the caller
has to plough through.
This patch causes _recvmmsg() to return as soon as it has got
the first EOF so the the caller can deal with it in good time
and not spin looking at the same thing over and over again.
I've also fixed a couple of typos in related comments