[vlc-devel] [PATCH] Windows store: don't call read() before poll() on network sockets

Rémi Denis-Courmont remi at remlab.net
Tue Oct 22 14:16:19 CEST 2013


On Mon, 21 Oct 2013 18:12:29 +0200, Denis Charmet <typx at dinauz.org> wrote:
> Le lundi 21 octobre 2013 à 03:05:01, Rafaël Carré a écrit :
>> +#if VLC_WINSTORE_APP
>> +    /* With winrtsock winsocks emulation library, the first call to
>> read()
>> +     * before poll() starts an asynchronous transfer and returns 0.
>> +     * Always call poll() first.
>> +     */
>> +    goto do_poll;
>> +#endif
> 
> Why even restrict that to WinRT?

Actually this work-around is wrong *even* on Windows RT: it fails to
address TLS as well as direct usage of TCP sockets (in the code base or in
contribs) bypassing net_Read().

> You can poll first then read everywhere.

To deal with buffers within GnuTLS, you would then need to abstract poll()
in addition to recv() and send(). However since poll() is multiplexed -
unlike recv() and send() - it cannot readily be abstracted.

-- 
Rémi Denis-Courmont
Sent from my collocated server



More information about the vlc-devel mailing list