• Rémi Denis-Courmont's avatar
    net_Read: rewrite, fix corner cases (fix #8972) · 3328b21b
    Rémi Denis-Courmont authored
    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.
io.c 13.7 KB