Configurable SO_RCVBUF/SO_SNDBUF for the UDP socket

This commit is contained in:
Brandon L Black 2010-11-13 12:05:49 -06:00 committed by Guus Sliepen
parent 3f410e2f8f
commit 8dfe1b374e
4 changed files with 32 additions and 0 deletions

View file

@ -405,6 +405,20 @@ bool setup_myself(void) {
} else
maxtimeout = 900;
if(get_config_int(lookup_config(config_tree, "UDPRcvBuf"), &udp_rcvbuf)) {
if(udp_rcvbuf <= 0) {
logger(LOG_ERR, "UDPRcvBuf cannot be negative!");
return false;
}
}
if(get_config_int(lookup_config(config_tree, "UDPSndBuf"), &udp_sndbuf)) {
if(udp_sndbuf <= 0) {
logger(LOG_ERR, "UDPSndBuf cannot be negative!");
return false;
}
}
if(get_config_string(lookup_config(config_tree, "AddressFamily"), &afname)) {
if(!strcasecmp(afname, "IPv4"))
addressfamily = AF_INET;