pingtimeout = pinginterval;
if(!get_config_int(lookup_config(config_tree, "MaxOutputBufferSize"), &maxoutbufsize))
- maxoutbufsize = 4 * MTU;
+ maxoutbufsize = 10 * MTU;
if(!setup_myself())
return false;
{
cp();
- /* If there already is a lot of data in the outbuf buffer, discard this packet. */
+ /* If there already is a lot of data in the outbuf buffer, discard this packet.
+ We use a very simple Random Early Drop algorithm. */
- if(c->outbuflen > maxoutbufsize)
+ if(2.0 * c->outbuflen / (double)maxoutbufsize - 1 > drand48())
return true;
if(!send_request(c, "%d %hd", PACKET, packet->len))