[vlc-devel] [PATCH 2/2] access/udp: Define MSG_TRUNC on recv call
remi at remlab.net
Mon Oct 15 18:20:39 CEST 2018
Le maanantaina 15. lokakuuta 2018, 18.23.44 EEST Ilkka Ollakka a écrit :
> On Mon, Oct 15, 2018 at 04:30:56PM +0200, Francois Cartegnie wrote:
> > Le 15/10/2018 à 16:21, Ilkka Ollakka a écrit :
> > > recv() needs MSG_TRUNC flag so it will tell actual data-size if truncate
> > > would happen additional to setting flag for it.
> > There's a regression on UDP since those changes which are supposed to
> > workaround buffer/block bloat.
> > But I doubt that solves the case of payloads > 1316 on non linux or
> > without msg_trunc.
> Yes, you are right, it doesn't solve it on linux < 2.2 or non-linux
> systems. Do you have such system to test on? I have one idea that should
> work in those cases.
You need a way to retrieve the size of the next message, or you need something
like MSG_TRUNC. Without either of those, nothing works.
We used to allocate insanely large buffers, and it was too slow. Memory copy
does not work either since the needed input buffer size would far exceed
reasonable stack usage - and memory copy sucks anyway.
More information about the vlc-devel