# HG changeset patch # User ramiro # Date 1187302323 0 # Node ID 2298213e3016867457f08f0799269942663b6bef # Parent de8377107b07b0c7af87c69d6a02c36093ce81d5 Set UDP receive buffer to 64k diff -r de8377107b07 -r 2298213e3016 udp.c --- a/udp.c Thu Aug 16 22:04:38 2007 +0000 +++ b/udp.c Thu Aug 16 22:12:03 2007 +0000 @@ -43,6 +43,7 @@ } UDPContext; #define UDP_TX_BUF_SIZE 32768 +#define UDP_MAX_PKT_SIZE 65536 #ifdef CONFIG_IPV6 @@ -396,6 +397,11 @@ perror("setsockopt sndbuf"); goto fail; } + } else { + /* set udp recv buffer size to the largest possible udp packet size to + * avoid losing data on OSes that set this too low by default. */ + tmp = UDP_MAX_PKT_SIZE; + setsockopt(udp_fd, SOL_SOCKET, SO_RCVBUF, &tmp, sizeof(tmp)); } s->udp_fd = udp_fd;