diff --git a/pkg/urbit/vere/io/ames.c b/pkg/urbit/vere/io/ames.c index a3783cf54..81f5635fc 100644 --- a/pkg/urbit/vere/io/ames.c +++ b/pkg/urbit/vere/io/ames.c @@ -42,6 +42,7 @@ time_t imp_t[256]; // imperial IP timestamps c3_o imp_o[256]; // imperial print status c3_o see_o; // can scry + c3_d saw_d; // successive scry failures c3_o fit_o; // filtering active c3_y ver_y; // protocol version c3_d vet_d; // version mismatches filtered @@ -655,24 +656,31 @@ _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) { - u3l_log("ames: giving up scry\n"); - pac_u->sam_u->see_o = c3n; + if (5 < ++pac_u->sam_u->saw_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 { - _ames_forward(pac_u, u3k(las)); + if (0 < pac_u->sam_u->saw_d) { + pac_u->sam_u->saw_d--; + } + // if there is no lane, drop the packet + // + 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 { + _ames_forward(pac_u, u3k(las)); + } } u3z(nun);