From d48078d4c3296122c3114c50ed42b3dd75e09801 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 21 Apr 2010 00:27:11 +0100 Subject: [PATCH] wip notice_processed; need new article states and counters --- backends/innduct.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/backends/innduct.c b/backends/innduct.c index b9460ed..9f032f4 100644 --- a/backends/innduct.c +++ b/backends/innduct.c @@ -240,7 +240,7 @@ typedef struct { struct Article { int midlen; - int checked, sentbody; + int checked; InputFile *ipf; TOKEN token; off_t offset; @@ -960,7 +960,6 @@ static void update_nocheck(int accepted) { } static void article_done(Connection *conn, Article *art, int whichcount) { - *count++; art->ipf->counts.articles[art->checked][whichcount]++; if (whichcount == RC_accepted) update_nocheck(1); else if (whichcount == RC_unwanted) update_nocheck(0); @@ -1173,7 +1172,7 @@ typedef void *feedfile_got_article(oop_source *lp, oop_read *rd, art->offset= ipf->offset; art->blanklen= recsz; art->midlen= midlen; - art->checked= art->sentbody= 0; + art->checked= 0; art->ipf= ipf; ipf->inprogress++; art->token= TextToToken(tokentextbuf); strcpy(art->messageid, space+1); @@ -1639,12 +1638,24 @@ static int inputfile_is_done(InputFile *ipf) { if (ipf->fd >= 0); return 0; /* not had EOF */ return 1; } - + +static void notice_processed(InputFile *ipf, const char *what, + const char *spec) { + info("processed %s%s checked=%d unchecked=%d sent=%d"); + wip; +} + static void statemc_check_backlog_done(void) { InputFile *ipf= backlog_input_file(); if (!inputfile_is_done(ipf)) return; - notice_processed(ipf,"backlog file",ipf->path); + const char *slash= strrchr(ipf->path, "/"); + const char *leaf= slash ? slash+1 : ipf->path; + const char *under= strchr(slash, "_"); + const char *rest= under ? under+1 : leaf; + if (!strncmp(rest,"backlog",7)) rest += 7; + notice_processed(ipf,"backlog:",rest); + close_input_file(ipf); if (unlink(ipf->path)) { if (errno != ENOENT) @@ -1665,7 +1676,7 @@ static void statemc_check_flushing_done(void) { assert(sms==sm_SEPARATED || sms==sm_DROPPING); - notice_processed(ipf,"feed file",0); + notice_processed(ipf,"feedfile",0); close_defer(); -- 2.30.2