Commit ce3bd683 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

udp: improve out-of-memory handling

parent ed69f1dc
...@@ -262,7 +262,11 @@ static void* ThreadRead( void *data ) ...@@ -262,7 +262,11 @@ static void* ThreadRead( void *data )
{ {
block_t *pkt = block_Alloc(MTU); block_t *pkt = block_Alloc(MTU);
if (unlikely(pkt == NULL)) if (unlikely(pkt == NULL))
break; { /* OOM - dequeue and discard one packet */
char dummy;
net_Read(access, sys->fd, &dummy, 1, false);
continue;
}
ssize_t len; ssize_t len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment