mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 04:48:00 +03:00
vere: properly clean up dropped laneless packets
Previously, if ames told us there was no lane for a target, we would drop the packet, but fail to register this in the queue, or even reclaim the memory it was using. Now, we do all the required book-keeping when dropping packets in the "no lane for this" case.
This commit is contained in:
parent
1e8158b683
commit
d76a5e9077
@ -655,20 +655,25 @@ _ames_lane_scry_cb(void* vod_p, u3_noun nun)
|
||||
// if scry fails, remember we can't scry, and just inject the packet
|
||||
//
|
||||
if (u3_none == las) {
|
||||
pac_u->sam_u->foq_d--;
|
||||
u3l_log("ames: giving up scry\n");
|
||||
pac_u->sam_u->see_o = c3n;
|
||||
_ames_put_packet(pac_u->sam_u,
|
||||
_ames_serialize_packet(pac_u, c3n),
|
||||
pac_u->ore_u);
|
||||
pac_u->sam_u->foq_d--;
|
||||
_ames_panc_free(pac_u);
|
||||
}
|
||||
// if there is no lane, drop the packet
|
||||
//
|
||||
else if (u3_nul == las) {
|
||||
pac_u->sam_u->foq_d--;
|
||||
_ames_panc_free(pac_u);
|
||||
}
|
||||
// if there is a lane, forward the packet on it
|
||||
//
|
||||
else if (u3_nul != las) {
|
||||
else {
|
||||
_ames_forward(pac_u, u3k(las));
|
||||
}
|
||||
// if there is no lane, drop the packet
|
||||
|
||||
u3z(nun);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user