X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=statemc.c;h=8d3e728c89a88d4258e36865f2967fe64351d1b1;hb=bcec484fa50155589573470c14fe63fc94d6438a;hp=dea31a9018090dfbda7a9fdebf12d57b602f4f29;hpb=8653f26be583f06fa9acff94f463755d896ed931;p=innduct.git diff --git a/statemc.c b/statemc.c index dea31a9..8d3e728 100644 --- a/statemc.c +++ b/statemc.c @@ -190,8 +190,12 @@ int trigger_flush_ok(const char *why) { case sm_SEPARATED: case sm_DROPPING: - warn("abandoning old feedfile after flush (%s), autodeferring", - why ? why : "took too long to complete"); + if (conns.count) + warn("abandoning old feedfile after flush (%s), autodeferring", + why ? why : "took too long to complete"); + else + info("autodeferring after flush (%s)", + why ? why : "no connections"); assert(flushing_input_file); autodefer_input_file(flushing_input_file); return 1; @@ -227,16 +231,14 @@ static void notice_processed_counts(Counts *counts, int completed, #define CNT(art,rc) (counts->results[art_##art][RC_##rc]) - assert(!completed || ipf_xtra); - - char *inprog= completed - ? xasprintf("%s","") /* GCC produces a stupid warning for printf("") ! */ - : xasprintf(" inprogress=%ld", ipf_xtra->inprogress); + char *inprog= ipf_xtra && !completed + ? xasprintf(" inprogress=%ld", ipf_xtra->inprogress) + : xasprintf("%s",""); /* GCC produces a stupid warning for printf("") ! */ char *autodefer= ipf_xtra && ipf_xtra->autodefer >= 0 ? xasprintf(" autodeferred=%ld", ipf_xtra->autodefer) : xasprintf("%s",""); - info("%s %s read=%d (+bl=%d,+err=%d)%s%s" + notice("%s %s read=%d (+bl=%d,+err=%d)%s%s" " missing=%d offered=%d (ch=%d,nc=%d) accepted=%d (ch=%d,nc=%d)" RESULT_COUNTS(RCI_NOTHING, RCI_TRIPLE_FMT) , @@ -251,7 +253,7 @@ static void notice_processed_counts(Counts *counts, int completed, RESULT_COUNTS(RCI_NOTHING, RCI_TRIPLE_VALS) ); - memset(&counts, 0, sizeof(*counts)); + memset(counts, 0, sizeof(*counts)); free(inprog); free(autodefer); @@ -305,7 +307,7 @@ void statemc_check_flushing_done(void) { assert(sms==sm_SEPARATED || sms==sm_DROPPING); - notice_processed_inputfile(ipf,1,"feedfile"); + notice_processed_inputfile(ipf,1,"batch"); close_defer(); @@ -502,6 +504,7 @@ void preterminate(void) { } void showstats(void) { + notice_conns_stats(); notice_processed_inputfile(main_input_file, 0, "feedfile"); notice_processed_inputfile(flushing_input_file, 0, "flushing");