Merge pull request #5826 from urbit/jb/sivc-no-punt

jets: remove +de:sivc punt logging
This commit is contained in:
Joe Bryan 2022-07-13 17:27:22 -04:00 committed by GitHub
commit dd8df1b2b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 48 additions and 35 deletions

View File

@ -387,6 +387,7 @@
# define c3__ergo c3_s4('e','r','g','o')
# define c3__esh c3_s3('e','s','h')
# define c3__etch c3_s4('e','t','c','h')
# define c3__evil c3_s4('e','v','i','l')
# define c3__ex c3_s2('e','x')
# define c3__exit c3_s4('e','x','i','t')
# define c3__eyre c3_s4('e','y','r','e')

View File

@ -149,9 +149,11 @@ _cqea_siv_de(c3_y* key_y,
txt_y = u3r_bytes_alloc(0, txt_w, txt);
out_y = u3a_malloc(txt_w);
ret = ( 0 != (*low_f)(txt_y, txt_w, dat_u, soc_w, key_y, iv_y, out_y) )
? u3_none
: u3nc(0, u3i_bytes(txt_w, out_y));
if ( 0 != (*low_f)(txt_y, txt_w, dat_u, soc_w, key_y, iv_y, out_y) ) {
return u3m_bail(c3__evil);
}
ret = u3nc(0, u3i_bytes(txt_w, out_y));
u3a_free(txt_y);
u3a_free(out_y);

View File

@ -1348,6 +1348,11 @@ u3m_soft(c3_w mil_w,
pro = u3nc(u3k(cod), u3_nul);
}
// %evil leaves no trace
//
else if ( c3__evil == cod ) {
pro = u3nc(u3k(cod), u3_nul);
}
else {
u3_noun mok = u3dc("mook", 2, u3k(tax));
pro = u3nc(u3k(cod), u3k(u3t(mok)));

View File

@ -52,6 +52,7 @@
c3_d foq_d; // forward queue size
c3_d fow_d; // forwarded count
c3_d fod_d; // forwards dropped count
c3_d bad_d; // bad ciphertext count
} sat_u; //
} u3_ames;
@ -768,51 +769,47 @@ _ames_cap_queue(u3_ames* sam_u)
}
}
/* _ames_punt_goof(): print %bail error report(s).
*/
static void
_ames_punt_goof(u3_noun lud)
{
if ( 2 == u3qb_lent(lud) ) {
u3_pier_punt_goof("hear", u3k(u3h(lud)));
u3_pier_punt_goof("crud", u3k(u3h(u3t(lud))));
}
else {
u3_noun dul = lud;
c3_w len_w = 1;
while ( u3_nul != dul ) {
u3l_log("ames: bail %u\r\n", len_w++);
u3_pier_punt_goof("ames", u3k(u3h(dul)));
dul = u3t(dul);
}
}
u3z(lud);
}
/* _ames_hear_bail(): handle packet failure.
*/
static void
_ames_hear_bail(u3_ovum* egg_u, u3_noun lud)
{
u3_ames* sam_u = (u3_ames*)egg_u->car_u;
sam_u->sat_u.fal_d++;
c3_w len_w = u3qb_lent(lud);
if ( (u3C.wag_w & u3o_verbose)
|| (0 == (sam_u->sat_u.fal_d % 1000)) )
{
_ames_punt_goof(lud);
u3l_log("ames: packet failed (%" PRIu64 " total)\n\n", sam_u->sat_u.fal_d);
if ( (1 == len_w) && c3__evil == u3h(u3h(lud)) ) {
sam_u->sat_u.bad_d++;
if ( (u3C.wag_w & u3o_verbose)
|| (0 == (sam_u->sat_u.bad_d % 100)) )
{
u3l_log("ames: heard bad crypto (%" PRIu64 " total), "
"check azimuth state\r\n",
sam_u->sat_u.bad_d);
}
}
else {
u3z(lud);
sam_u->sat_u.fal_d++;
if ( 0 == (sam_u->sat_u.fal_d % 1000) ) {
u3l_log("ames: packet failed (%" PRIu64 " total)\n\n", sam_u->sat_u.fal_d);
if ( (u3C.wag_w & u3o_verbose)
|| (0 == (sam_u->sat_u.fal_d % 100)) )
{
if ( 2 == len_w ) {
u3_pier_punt_goof("hear", u3k(u3h(lud)));
u3_pier_punt_goof("crud", u3k(u3h(u3t(lud))));
}
// !2 traces is unusual, just print the first if present
//
else if ( len_w ) {
u3_pier_punt_goof("hear", u3k(u3h(lud)));
}
u3l_log("ames: packet failed (%" PRIu64 " total)\r\n",
sam_u->sat_u.fal_d);
}
}
u3z(lud);
u3_ovum_free(egg_u);
}

View File

@ -565,6 +565,14 @@ _serf_work(u3_serf* sef_u, c3_w mil_w, u3_noun job)
sef_u->mug_l,
vir));
}
// event rejected -- bad ciphertext
//
else if ( c3__evil == u3h(gon) ) {
sef_u->sen_d = sef_u->dun_d;
u3z(job);
return u3nt(c3__bail, gon, u3_nul);
}
// event rejected
//
else {