chiark / gitweb /
some fixes; debug for missing
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 30 Apr 2010 19:09:02 +0000 (20:09 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Fri, 30 Apr 2010 19:09:02 +0000 (20:09 +0100)
backends/innduct.c

index acbae608ad4ecef16452814f886d56ef3a565d8d..f28db2edfc6330259bbfe25225186f32b12c7dc9 100644 (file)
@@ -4,15 +4,14 @@
 
  [740] <sit> info: processed feedfile(null) read=4(+0bl,+6err) offered=5(ch5,nc0) accepted=0(ch0+nc0) unwanted=0(0id+0bd+0nc) rejected=0(0id+0bd+0nc) deferred=0(0id+0bd+0nc) missing=2(0id+2bd+0nc) connretry=0(0id+0bd+0nc)
 
-    (null) ?!
-
    also unwanted should be nonzero I think
 
-   %d(  is too hard to read
-
  [740] <sit> warning: corrupted file: /home/ian/things/Innfeed/inn2-2.4.5/fee, offset 349: line partially blanked: in `                                                  @050000002D130000006A0000000000000000@ <mi'..
 
 
+
+ * some per-conn info thing for control
+
  * todo
  *  - actually do something with readable on control master
  *  - option for realsockdir
@@ -387,7 +386,7 @@ typedef enum {      /* in queue                 in conn->sent             */
   RCN(missing)                                 \
   RCN(connretry)
 
-#define RCI_TRIPLE_FMT_BASE "%d(%did+%dbd+%dnc)"
+#define RCI_TRIPLE_FMT_BASE "%d (id=%d,bod=%d,nc=%d)"
 #define RCI_TRIPLE_VALS_BASE(counts,x)         \
        counts[art_Unchecked] x                 \
        + counts[art_Wanted] x                  \
@@ -1534,6 +1533,8 @@ static void conn_make_some_xmits(Conn *conn) {
        (abort(),-1);
 
       if (!artdata) art->missing= 1;
+fprintf(stderr,"INC %d %d?%d:%d\n",(int)art->state,
+       !!artdata, (int)RC_sent, (int)RC_missing);
       art->ipf->counts[art->state][ artdata ? RC_sent : RC_missing ]++;
 
       if (conn->stream) {
@@ -1568,6 +1569,7 @@ static void conn_make_some_xmits(Conn *conn) {
       XMIT_LITERAL("\r\n");
 
       assert(art->state == art_Unchecked);
+fprintf(stderr,"INC %d %d\n",(int)art->state,(int)RC_sent);
       art->ipf->counts[art->state][RC_sent]++;
       LIST_ADDTAIL(conn->sent, art);
     }
@@ -1665,6 +1667,7 @@ static void update_nocheck(int accepted) {
 }
 
 static void article_done(Conn *conn, Article *art, int whichcount) {
+fprintf(stderr,"INC %d %d\n",(int)art->state,whichcount);
   if (!art->missing) art->ipf->counts[art->state][whichcount]++;
 
   if (whichcount == RC_accepted) update_nocheck(1);
@@ -1674,6 +1677,11 @@ static void article_done(Conn *conn, Article *art, int whichcount) {
 
   while (art->blanklen) {
     static const char spaces[]=
+      "                                                                "
+      "                                                                "
+      "                                                                "
+      "                                                                "
+      "                                                                "
       "                                                                "
       "                                                                "
       "                                                                "
@@ -1770,6 +1778,7 @@ static void *peer_rd_ok(oop_source *lp, oop_read *oread, oop_rd_event ev,
   case 335: /* IHAVE says send it */
     GET_ARTICLE(-1);
     assert(art->state == art_Unchecked);
+fprintf(stderr,"INC %d %d\n",(int)art->state,(int)RC_accepted);
     art->ipf->counts[art->state][RC_accepted]++;
     art->state= art_Wanted;
     LIST_ADDTAIL(conn->priority, art);
@@ -2408,8 +2417,8 @@ static void notice_processed(InputFile *ipf, const char *what,
 
 #define CNT(art,rc) (ipf->counts[art_##art][RC_##rc])
 
-  info("processed %s%s read=%d(+%dbl,+%derr)"
-       " offered=%d(ch%d,nc%d) accepted=%d(ch%d+nc%d)"
+  info("processed %s%s read=%d (+bl=%d,+err=%d)"
+       " offered=%d (ch=%d,nc=%d) accepted=%d (ch=%d,nc=%d)"
        RESULT_COUNTS(RCI_NOTHING, RCI_TRIPLE_FMT)
        ,
        what, spec,
@@ -2433,7 +2442,7 @@ static void statemc_check_backlog_done(void) {
   const char *under= strchr(slash, '_');
   const char *rest= under ? under+1 : leaf;
   if (!strncmp(rest,"backlog",7)) rest += 7;
-  notice_processed(ipf,"backlog:",rest);
+  notice_processed(ipf,"backlog ",rest);
 
   close_input_file(ipf);
   if (unlink(ipf->path)) {
@@ -2455,7 +2464,7 @@ static void statemc_check_flushing_done(void) {
 
   assert(sms==sm_SEPARATED || sms==sm_DROPPING);
 
-  notice_processed(ipf,"feedfile",0);
+  notice_processed(ipf,"feedfile","");
 
   close_defer();
 
@@ -2467,7 +2476,7 @@ static void statemc_check_flushing_done(void) {
 
   if (sms==sm_SEPARATED) {
     notice("flush complete");
-    SMS(NORMAL, 0, "flush complete");
+    SMS(NORMAL, spontaneous_flush_periods, "flush complete");
   } else if (sms==sm_DROPPING) {
     SMS(DROPPED, 0, "old flush complete");
     search_backlog_file();
@@ -2905,7 +2914,7 @@ static char *debug_report_ipf(InputFile *ipf) {
   return xasprintf("%p/%s:ip=%ld,off=%ld,fd=%d%s",
                   ipf, path,
                   ipf->inprogress, (long)ipf->offset,
-                  ipf->fd, ipf->rd ? "+" : "");
+                  ipf->fd, ipf->rd ? "" : ",!rd");
 }
 
 static void period(void) {
@@ -2915,7 +2924,7 @@ static void period(void) {
 
   debug("PERIOD"
        " sms=%s[%d] conns=%d queue=%d until_connect=%d"
-       " input_files main:%s old:%s flushing:%s"
+       " input_files main:%s flushing:%s backlog:%s"
        " children connecting=%ld inndcomm=%ld"
        ,
        sms_names[sms], sm_period_counter,