quic: fix stream tx_fifo race condition 54/23754/4
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>
Tue, 3 Dec 2019 14:08:27 +0000 (15:08 +0100)
committerDave Wallace <dwallacelf@gmail.com>
Wed, 4 Dec 2019 18:08:51 +0000 (18:08 +0000)
commitc9cb8f6d9c6e1f51dfdf3e9f4ba0c9f38d1ca6d6
tree88a0ebd269caeceb3dc1a7df4867d527455269ef
parentd9577b4aa3a325e46c09796835d22122bec9e3d0
quic: fix stream tx_fifo race condition

Type: fix

There is a race condition in when receiving TX from
a client application :
As egress_emit writes as much data as possible to
the stream, if during egress_emit the app writes
to the fifo, the data will be directly passed to
quicly. Then TX callback happens and triggers
a scheduler update telling quilcy the stream has
data to send. When the next egress_emit is called
and no more data has come, we have nothing to write,
we return len = 0 to quicly which breaks an assert if
a loss happens later on.

Change-Id: I47e00a14dfc9068b5dac7b5c090a89124aea004f
Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
src/plugins/quic/quic.c
src/plugins/quic/quic.h