Thread View: news.software.nntp
1 messages
1 total messages
Started by Steinar Haug
Sun, 16 Mar 1997 00:00
Patch to add Path header (only) feed option
Author: Steinar Haug
Date: Sun, 16 Mar 1997 00:00
Date: Sun, 16 Mar 1997 00:00
107 lines
4113 bytes
4113 bytes
When running one of the 'inpaths' variants, it would be useful to have
a feed option which writes *only* the Path header. The following patch
adds such an option, using the letter 'P'. It can be used like this:
INPATHS!\
:*,!junk,!control,!control.*,!to,!to.*\
:Tc,WP:/news/bin/chaninpaths -p -h uninett.no /var/log/news/inpaths.log
Note that the Path header is written *without* the initial 'Path: ', and
that most 'inpaths' versions seem to want the initial 'Path: ' also. Thus
you either need to modify your 'inpaths' program, or add 'Path: ' again
(should be very easy).
I also have such a modified 'inpaths' program (basically Sean Donelan's
'chaninpaths', with Landon Noll's hash improvements added), but I'm going
to discuss it with the authors before distributing it. (I'm not entirely
satisfied with my modifications so far.)
Steinar Haug, Nethelp consulting, sthaug@nethelp.no
----------------------------------------------------------------------
*** include/configdata.h.orig Tue Dec 17 15:40:40 1996
--- include/configdata.h Sun Mar 16 10:49:32 1997
***************
*** 391,396 ****
--- 391,397 ----
#define FEED_NAME 'n'
#define FEED_NEWSGROUP 'g'
#define FEED_OVERVIEW 'O'
+ #define FEED_PATH 'P'
#define FEED_REPLIC 'R'
#define FEED_SITE 's'
#define FEED_TIMERECEIVED 't'
*** innd/innd.h.orig Mon Feb 24 11:31:17 1997
--- innd/innd.h Sun Mar 16 10:10:03 1997
***************
*** 298,303 ****
--- 298,305 ----
int DistributionLength;
STRING Feedsite;
int FeedsiteLength;
+ STRING Path;
+ int PathLength;
STRING Replic;
int ReplicLength;
BUFFER *Headers;
***************
*** 384,389 ****
--- 386,392 ----
EXTERN BOOL ICDneedsetup;
EXTERN BOOL NeedHeaders;
EXTERN BOOL NeedOverview;
+ EXTERN BOOL NeedPath;
EXTERN BOOL NNRPFollows;
extern BOOL NNRPTracing;
extern BOOL StreamingOff;
*** innd/art.c.orig Mon Feb 24 11:31:17 1997
--- innd/art.c Sun Mar 16 10:29:01 1997
***************
*** 563,568 ****
--- 563,575 ----
size += (vp++)->iov_len;
vp->iov_base = p;
vp->iov_len = Data->Body - p;
+ if (NeedPath) {
+ Data->Path = p;
+ for (i = Data->Body - p; --i >= 0; p++)
+ if (*p == '\n')
+ break;
+ Data->PathLength = p - Data->Path;
+ }
size += (vp++)->iov_len;
if (ARTheaders[_lines].Found == 0) {
(void)sprintf(Data->Lines, "Lines: %d\n", Data->LinesValue);
*** innd/newsfeeds.c.orig Tue Dec 17 15:40:40 1996
--- innd/newsfeeds.c Sun Mar 16 10:10:56 1997
***************
*** 336,341 ****
--- 336,344 ----
case FEED_OVERVIEW:
NeedOverview = TRUE; /* Overview data */
break;
+ case FEED_PATH: /* Path */
+ NeedPath = TRUE;
+ break;
case FEED_BYTESIZE: /* Size in bytes */
case FEED_FULLNAME: /* Full filename */
case FEED_HDR_DISTRIB: /* Distribution header */
*** innd/site.c.orig Tue Dec 17 15:40:40 1996
--- innd/site.c Sat Mar 15 23:03:53 1997
***************
*** 368,373 ****
--- 368,379 ----
BUFFappend(bp, ITEMSEP, STRLEN(ITEMSEP));
BUFFappend(bp, Data->Overview->Data, Data->Overview->Left);
break;
+ case FEED_PATH:
+ if (Dirty)
+ BUFFappend(bp, ITEMSEP, STRLEN(ITEMSEP));
+ BUFFappend(bp, Path.Data, Path.Used);
+ BUFFappend(bp, Data->Path, Data->PathLength);
+ break;
case FEED_REPLIC:
if (Dirty)
BUFFappend(bp, ITEMSEP, STRLEN(ITEMSEP));
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads