X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fprotocol_misc.c;fp=src%2Fprotocol_misc.c;h=6b3c4ab80637679f247895c646ec0f29e46d2177;hb=0bdce44687a22c8825695cba185b845f5ea5e060;hp=b44708085a92d80d3ca0e707ccbc5215acfa37f3;hpb=76c7550c8ab0e9c0ee14a9c396baa008cfb9bc42;p=meshlink diff --git a/src/protocol_misc.c b/src/protocol_misc.c index b4470808..6b3c4ab8 100644 --- a/src/protocol_misc.c +++ b/src/protocol_misc.c @@ -125,7 +125,7 @@ bool send_tcppacket(meshlink_handle_t *mesh, connection_t *c, const vpn_packet_t /* 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(2.0 * c->outbuf.len / (float)maxoutbufsize - 1 > (float)rand()/(float)RAND_MAX) + if(2.0 * c->outbuf.len / (float)maxoutbufsize - 1 > (float)rand() / (float)RAND_MAX) return true; if(!send_request(mesh, c, "%d %hd", PACKET, packet->len))