diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2020-05-17 17:09:18 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2020-05-17 17:09:18 +0300 |
commit | 49de98a30b8b5b45d30bcd4b8136a5b4cfe80fcd (patch) | |
tree | 459b3abe97d815dd40838be408998b3520ed9142 /src/verify.c | |
parent | ebeb897b2b4f81224d541c6711b76e1c360e377a (diff) | |
download | wydawca-49de98a30b8b5b45d30bcd4b8136a5b4cfe80fcd.tar.gz wydawca-49de98a30b8b5b45d30bcd4b8136a5b4cfe80fcd.tar.bz2 |
Fix deadlock at wy_vlog
* src/stat.c: New file.
* src/wydawca.c (wy_log): Don't touch statistic counters. This causes
deadlock when wy_v?log is called from statistic-reporting module.
* src/wydawca.h (wydawca_stat_log): Remove proto.
* src/gpg.c: Increase WY_STAT_ERRORS explicitly.
* src/triplet.c: Likewise.
* src/verify.c: Likewise.
* tests/dry_run01.at: Fix expected output.
* tests/upload01.at: Likewise.
Diffstat (limited to 'src/verify.c')
-rw-r--r-- | src/verify.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/verify.c b/src/verify.c index 39626f3..c3b1845 100644 --- a/src/verify.c +++ b/src/verify.c @@ -133,6 +133,7 @@ fill_project_name(struct wy_triplet *trp) trp->blurb = blurb; if (directive_parse(trp)) { + wydawca_stat_incr(WY_STAT_ERRORS); free(blurb); trp->blurb = NULL; return 1; @@ -189,13 +190,18 @@ real_verify_directive_file(struct wy_triplet *trp) if (!wy_triplet_get_uploaders(trp)) return DIRECTIVE_BAD; - if (verify_directive_signature(trp)) { - /*FIXME: Update stats */ + switch (verify_directive_signature(trp)) { + case 0: + wy_debug(1, (_("%s: directive file signature OK"), trp->name)); + break; + case 1: wy_log(LOG_ERR, _("invalid signature for %s"), trp->name ? trp->name : "[unknown]"); return DIRECTIVE_BAD; - } else - wy_debug(1, (_("%s: directive file signature OK"), trp->name)); + case -1: + wydawca_stat_incr(WY_STAT_ERRORS); + return DIRECTIVE_BAD; + } if (wy_debug_level > 1) { int i; @@ -203,9 +209,11 @@ real_verify_directive_file(struct wy_triplet *trp) wy_log(LOG_DEBUG, "directive[%d] = %s", i, trp->directive[i]); } - if (verify_directive_format(trp)) + if (verify_directive_format(trp)) { + wydawca_stat_incr(WY_STAT_ERRORS); return DIRECTIVE_BAD; - + } + return DIRECTIVE_GOOD; } |