Article View: news.software.nn
Article #1196Re: News postings appear to have uncertain length (Summary)
From: David Boyce
Date: Mon, 03 Dec 1990 17:33
Date: Mon, 03 Dec 1990 17:33
142 lines
5399 bytes
5399 bytes
Dear nnetters,
Many thanks for the helpful advice offered. Here is a summary:
Firstly, the original question:
Postings from our (recently netted) site do not appear to have a length
which makes sense when we read them using our nn, e.g.
a Some author ? Some topic or other...
^never see a number here for postings from our site.
nn Release 6.4.10 #12 is installed.
Next, some general comments:
Everyone said 'I bet you're running Cnews' or something similar. They were
right (and still are 8-|). Therefore, if you have this problem and are not
running Cnews, this summary won't help you.
The basic problem is that our Cnews software is not creating a Lines: header
on outgoing posts, and that without this header entry nn puts up the ? in the
line count field.
What *was* interesting was that at least one site *did* see a length for my
posting (28 lines) -- someone is doing some counting... This was corroborated
by a comment which implied that some gateways do their own counting, and get it
wrong (I've certainly noticed some short postings whose actual length was
shorter than their announced length).
Solutions were offered involving two separate areas:
1) Removing comments from the Inews script
2) Patching news.c.
The 'Inews script' fix worked for us - we didn't try the patch to news.c.
So, here are the two basic solutions, as suggested by the people who were good
enough to send them (I've taken the liberty of including these verbatim, since
there is little padding to strip out and I don't want to risk altering their
meaning by attempting to condense them):
1) Removing comments from the Inews script (thanks to Scott Reynolds)
It looks like you're running C News on your system, from the looks of
the message ID line. That's your problem, not nn; what you need to do
is enable the line counter in the inews script. If you search for the
word "Lines:" you will see a block of the script commented out with "#"
in the beginning -- removing the leading "#" on that block will give you
the line count you want.
2) Patching news.c (Thanks to Paul Eggert)
We had this problem too. We're running Cnews, which doesn't put a Lines: line
into the news header (the Cnews folks feel that it's inefficient to put it into
the header, since you can count it from the data). The '?' means the news item
doesn't have a Lines: count.
Here's a quick patch: it's not perfect, but it fixed our problem. Kim Storm
says a better patch will be in the next release or two of NN.
===================================================================
RCS file: RCS/news.c,v
retrieving revision 1.1
diff -c -r1.1 news.c
*** 1.1 1990/10/23 21:37:38
--- news.c 1990/10/23 22:54:32
***************
*** 230,236 ****
char *digest_buffer;
char *parse_header();
struct stat statb;
! int retry;
FILE *f;
#ifdef NNTP
int lazy;
--- 230,236 ----
char *digest_buffer;
char *parse_header();
struct stat statb;
! int c, retry;
FILE *f;
#ifdef NNTP
int lazy;
***************
*** 299,310 ****
body = parse_header(f, art_hdr_field, modes, buffer1);
- news.ng_lines = news.ng_xlines ? atoi(news.ng_xlines) : -1;
if (news.ng_from == NULL) news.ng_from = news.ng_sender;
! if (modes & FILL_OFFSETS) {
art->fpos = news.ng_fpos = ftell(f);
fseek(f, (off_t)0, 2);
news.ng_lpos = ftell(f);
}
--- 299,319 ----
body = parse_header(f, art_hdr_field, modes, buffer1);
if (news.ng_from == NULL) news.ng_from = news.ng_sender;
! if (modes & FILL_OFFSETS)
art->fpos = news.ng_fpos = ftell(f);
+ if (news.ng_xlines)
+ news.ng_lines = atoi(news.ng_xlines);
+ else {
+ news.ng_lines = 0;
+ while ((c = getc(f)) != EOF)
+ if (c == '\n')
+ news.ng_lines++;
+ }
+
+ if (modes & FILL_OFFSETS) {
fseek(f, (off_t)0, 2);
news.ng_lpos = ftell(f);
}
===================================================================
End of Solutions.
Finally, many thanks again to all who took an interest (sorry if you've not
received a personal acknowledgement - it means my mailer could resolve your
reply address).
I look forward to future net interactions (this has been a positive experience
for a first-time posting).
Regards, David Boyce.
--
David Boyce (David.Boyce@hemel.bull.co.uk)
Tel: +44-442-232222 x4468 BULL HN Information Systems Ltd.
Fax: +44-442-234084 1, Three Cherry Trees Lane,
Hemel Hempstead, Herts HP2 7DZ
This has nothing to do with BULL ...
Technical Details
Message-ID:
<1990Dec3.173321.9305@hemel.bull.co.uk>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmdzi!unido!mcsun!uunet!samsung!know!pluto.hemel.bull.co.uk!boyceReferences:
<1990Nov29.175114.19632@hemel.bull.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <1990Dec3.173321.9305@hemel.bull.co.uk> Subject: Re: News postings appear to have uncertain length (Summary) Date: Mon, 03 Dec 1990 17:33:21 +0000 From: boyce@hemel.bull.co.uk (David Boyce) References: <1990Nov29.175114.19632@hemel.bull.co.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmdzi!unido!mcsun!uunet!samsung!know!pluto.hemel.bull.co.uk!boyce Newsgroups: news.software.nn Sender: @hemel.bull.co.uk Organization: Bull HN UK Lines: 142 Posted: Mon Dec 3 18:33:21 1990 Nntp-Posting-Host: brno