🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nn
6 messages
6 total messages Started by David Boyce Thu, 29 Nov 1990 17:51
News postings appear to have uncertain length
#1177
Author: David Boyce
Date: Thu, 29 Nov 1990 17:51
28 lines
1596 bytes
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.

Is this 
a) purely our own local problem (i.e. do you get the same phenomenon
   reading this on your site) , and/or
b) something wrong in our nn configuration?
c) some other usage problem?

We would like to be confident that appropriate lengths are being sent out
to the world at large, and also see them ourselves...

Thanks in advance for thoughts, suggestions, advice etc.

nn Release 6.4.10 #12 is installed.

--
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
(My .signature Cabinet is in the process of being shuffled)
Re: News postings appear to have uncertain length
#1194
Author: Russell J Fulton;ccc032u
Date: Mon, 03 Dec 1990 00:54
15 lines
1160 bytes
boyce@hemel.bull.co.uk (David Boyce) writes:

>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.

We have the same thing here.


-- 
Russell Fulton, Computer Center, University of Auckland, New Zealand.
<rj_fulton@aukuni.ac.nz>
Re: News postings appear to have uncertain length
#1189
Author: David E A Wilson
Date: Mon, 03 Dec 1990 01:47
11 lines
1294 bytes
russell@ccu1.aukuni.ac.nz (Russell J Fulton;ccc032u) writes:
>boyce@hemel.bull.co.uk (David Boyce) writes:
>>a Some author      ?  Some topic or other...
>>		     ^never see a number here for postings from our site.
>We have the same thing here.

We had the same problem when we upgraded from b-news to c-news. C-news does NOT
include a Lines: header in messages by default. THe code to include it is in the
c-news distribution but commented out.
-- 
David Wilson	Dept Comp Sci, Uni of Wollongong	david@cs.uow.edu.au
Re: News postings appear to have uncertain length
#1191
Author: Paul Eggert
Date: Mon, 03 Dec 1990 03:33
71 lines
2570 bytes
boyce@hemel.bull.co.uk (David Boyce) writes:

>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...

This is because C News does not output `Lines:' in the header.
I think this will be fixed in a future NN release.
If you can't wait, the following patch works for us.


===================================================================
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);
  	}
Re: News postings appear to have uncertain length
#1201
Author: Peter Andersen
Date: Mon, 03 Dec 1990 07:57
6 lines
1139 bytes
If the Lines: header is missing in postings, it is probably because
it was posted from a C-news site. The inews that comes with C-news doesn't
generate the Lines: header. However, the code for it *is* in the script:
Just uncomment it, and you will get the Lines: header.

Peter
Re: News postings appear to have uncertain length (Summary)
#1196
Author: David Boyce
Date: Mon, 03 Dec 1990 17:33
142 lines
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 ...
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