Ticket #84: status.diff

File status.diff, 3.8 KB (added by eagle, 15 years ago)

Patch against CURRENT 20060829

  • doc/pod/inn.conf.pod

    diff -ur CURRENT-20060829.orig/doc/pod/inn.conf.pod CURRENT-20060829/doc/pod/inn.conf.pod
    old new  
    10251025report is written to I<pathhttp>/inn_status.html.  If this is set to C<0> or
    10261026C<false>, status reporting is disabled.  The default value is C<0>.
    10271027
     1028=item I<logstatus>
     1029
     1030Boolean value indicating that innd(8) should write a shortened version of
     1031its status report to syslog every C<status> seconds.
     1032
    10281033=item I<timer>
    10291034
    10301035How frequently (in seconds) innd(8) should report performance timings to
  • include/inn/innconf.h

    diff -ur CURRENT-20060829.orig/include/inn/innconf.h CURRENT-20060829/include/inn/innconf.h
    old new  
    139139    long nntpactsync;           /* Checkpoint log after this many articles */
    140140    bool nntplinklog;           /* Put storage token into the log? */
    141141    long status;                /* Status file update interval */
     142    bool logstatus;             /* Send a status report to syslog? */
    142143    long timer;                 /* Performance monitoring interval */
    143144    char *stathist;             /* Filename for history profiler outputs */
    144145
  • CURRENT-20060829

    diff -ur CURRENT-20060829.orig/innd/status.c CURRENT-20060829/innd/status.c
    old new  
    291291  fprintf (F, "   rejected size: %-7s    %%rejected size: %.1f%%\n",
    292292           PrettySize(RejectSize, str), (float) RejectSize / size * 100);
    293293  fputc ('\n', F) ;
    294  
     294
     295  if(innconf->logstatus) {
     296    notice ("%s status seconds %ld accepted %ld "
     297                  "refused %ld rejected %ld duplicated %ld "
     298                  "accepted size %.0f duplicate size %.0f rejected size %.0f\n",
     299                "ME", (long) seconds, accepted,
     300                  refused, rejected, duplicate,
     301                  size, DuplicateSize, RejectSize);
     302  }
     303
    295304  /* Incoming Feeds */
    296305  for (status = head ; status != NULL ;) {
    297306    fprintf (F, "%s\n",                      status->name);
     
    335344             NNTP_ERR_GOTID_VAL, status->Check_cybercan);
    336345    }
    337346    fputc ('\n', F) ;
     347
     348    if(innconf->logstatus) {
     349      notice("%s status seconds %ld accepted %ld "
     350                  "refused %ld rejected %ld duplicated %ld "
     351                  "accepted size %.0f duplicate size %.0f rejected size %.0f\n",
     352                 status->name, (long) status->seconds, status->accepted,
     353                    status->refused, status->rejected, status->Duplicate,
     354                    status->Size, status->DuplicateSize, status->RejectSize);
     355    }
     356
    338357    tmp = status->next;
    339358    free(status);
    340359    status = tmp;
     
    346365#endif /* defined(HTML_STATUS) */
    347366
    348367  Fclose(F);
     368  free(path);
    349369}
    350370
    351371void
  • CURRENT-20060829

    diff -ur CURRENT-20060829.orig/lib/innconf.c CURRENT-20060829/lib/innconf.c
    old new  
    171171    { K(remembertrash),         BOOL    (true) },
    172172    { K(stathist),              STRING  (NULL) },
    173173    { K(status),                NUMBER  (0) },
     174    { K(logstatus),             BOOL    (false) },
    174175    { K(verifycancels),         BOOL    (false) },
    175176    { K(wanttrash),             BOOL    (false) },
    176177    { K(wipcheck),              NUMBER  (5) },
  • samples/inn.conf.in

    diff -ur CURRENT-20060829.orig/samples/inn.conf.in CURRENT-20060829/samples/inn.conf.in
    old new  
    144144nntpactsync:            200
    145145nntplinklog:            false
    146146status:                 0
     147logstatus:              false
    147148timer:                  0
    148149
    149150# System Tuning