mirror of
https://github.com/urbit/shrub.git
synced 2024-12-20 09:21:42 +03:00
ames: cap ovum queue at 1k, dropping oldest packets first
This commit is contained in:
parent
755b2f1347
commit
82e06c31eb
@ -394,6 +394,22 @@ _ames_recv_cb(uv_udp_t* wax_u,
|
||||
}
|
||||
|
||||
u3_auto_plan(&sam_u->car_u, 0, c3__a, wir, cad);
|
||||
|
||||
// cap ovum queue at 1k, dropping oldest packets
|
||||
//
|
||||
{
|
||||
u3_ovum* egg_u = sam_u->car_u.ext_u;
|
||||
|
||||
while ( 1000 < sam_u->car_u.dep_w ) {
|
||||
u3_ovum* nex_u = egg_u->nex_u;
|
||||
|
||||
if ( c3__hear == u3h(egg_u->cad) ) {
|
||||
u3_auto_drop(&sam_u->car_u, egg_u);
|
||||
}
|
||||
|
||||
egg_u = nex_u;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
c3_free(buf_u->base);
|
||||
|
Loading…
Reference in New Issue
Block a user