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

Rafaël Carré funman at videolan.org
Mon Oct 21 18:17:28 CEST 2013


Le 21/10/2013 18:12, Denis Charmet a écrit :
> 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? You can poll first then read
> everywhere.

This was the case before this commit:

commit 3328b21b5b18721ff541cb326ff472a42d1bef4f
Author: Rémi Denis-Courmont <remi at remlab.net>
Date:   Sun Jul 21 19:37:06 2013 +0300

    net_Read: rewrite, fix corner cases (fix #8972)

    This new implementation opportunistically tries to read data before
    invoking poll(). This reduces latency when data is already waiting in
    buffers, allows receiving pending data in non-blocking fashion even if
    the object has been killed. This also gives GnuTLS a chance to dequeue
    data from internal buffers.

    Also the corner case of 0 read should now be handled correctly.

    The corner case of an error after success read is no longer handled.
    This was race-prone and useless.


Note this patch misses:
 if (!vs) goto do_poll;

to not reintroduce the same bug, although I am not sure if we can use
gnutls on Windows Store.

> Regards,
> 




More information about the vlc-devel mailing list