Fix a bug that caused a crash on empty HTTP requests (localhost only) and add a lightweight lock to the RX queue to prevent possible threads stepping on each other in parallel receive paths.

This commit is contained in:
Adam Ierymenko 2018-07-20 14:01:58 -07:00
parent 9bc11a369c
commit 5b114791e5
4 changed files with 8 additions and 3 deletions

View file

@ -159,6 +159,7 @@ private:
unsigned int totalFragments; // 0 if only frag0 received, waiting for frags
uint32_t haveFragments; // bit mask, LSB to MSB
volatile bool complete; // if true, packet is complete
Mutex lock;
};
RXQueueEntry _rxQueue[ZT_RX_QUEUE_SIZE];
AtomicCounter _rxQueuePtr;