Skip to content

Commit

Permalink
ames: forward iff we're a galaxy (#493)
Browse files Browse the repository at this point in the history
Resolves #492.
  • Loading branch information
matthew-levan authored Jul 14, 2023
2 parents d313f08 + 1af525d commit e37e1f1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/vere/io/ames.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
c3_d fod_d; // forwards dropped count
c3_d foq_d; // forward queue size
c3_d fow_d; // forwarded count
c3_o for_o; // forwarding enabled
c3_d hed_d; // failed to read header
c3_d vet_d; // version mismatches filtered
c3_d mut_d; // invalid mugs filtered
Expand Down Expand Up @@ -1993,7 +1994,9 @@ _ames_hear(u3_ames* sam_u,
&& ( (pac_u->pre_u.rec_d[0] != sam_u->pir_u->who_d[0])
|| (pac_u->pre_u.rec_d[1] != sam_u->pir_u->who_d[1]) ) )
{
_ames_try_forward(pac_u);
if ( c3y == sam_u->sat_u.for_o ) {
_ames_try_forward(pac_u);
}
}
else {
// enter protocol-specific packet handling
Expand Down Expand Up @@ -2458,6 +2461,11 @@ u3_ames_io_init(u3_pier* pir_u)
sam_u->fig_u.see_o = c3y;
sam_u->fig_u.fit_o = c3n;

// enable forwarding on galaxies only
u3_noun who = u3i_chubs(2, sam_u->pir_u->who_d);
u3_noun rac = u3do("clan:title", who);
sam_u->sat_u.for_o = ( c3__czar == rac ) ? c3y : c3n;

// hashtable for scry cache
//
// 1500 bytes per packet * 100_000 = 150MB
Expand Down

0 comments on commit e37e1f1

Please sign in to comment.