james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Noel J. Bergman" <n...@devtech.com>
Subject RE: NNTP and Line Count
Date Mon, 14 Apr 2003 05:43:31 GMT

Please submit a patch.  This sounds like a compatible change.  However,
should the lines be counted and passed from NNTPHandler somehow?  We should
have the line count for free from there.  I'd have to go back and look at
the code, but if we could get that from NNTPHandler, doesn't that reduce the

	--- Noel

-----Original Message-----
From: Kevin Schmidt [mailto:ktschmidt@earthlink.net]
Sent: Saturday, April 12, 2003 1:13
To: James Developers List
Subject: NNTP and Line Count


I am looking at using James as my NNTP server but had noticed that the
line count reported in my news reader is always -1.  In looking at the
2.1.2 source it looks like getting this working is one of the TODO's.

To try to get it working for myself, I went ahead and implemented
something that seems to work fine with Mozilla and Netscape readers and
wanted to run it by those on the mailing list to confirm what I've done
is correct and possibly get it included in the source tree.

What I did was two things.

First, in NNTPSpooler I modified SpoolerRunnable.process to check and
see if there is a "Lines" header and if not, it counts the lines in the
body and sets the "Lines" header and write the message back out prior to
copying the message to the respective groups.  This effectively ensures
there is a "Lines" header in the article.

Second, I modified NNTPArticleImpl.writeOverview to get the "Lines"
header and use it in the response rather than the hardcoded -1.  I also
added code to count the lines in the body if the header isn't present
but this code is only useful if there are pre-existing articles that
don't have the "Lines" header present.

With these two changes I get the line count reported in my newsreader
correctly for both existing messages and new posts.

If this sounds correct, I'd be happy to provide my changes to whomever
or check them into CVS is that is appropriate.



To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org

View raw message