Thread View: news.software.readers
2 messages
2 total messages
Started by Tony Galliford
Mon, 02 Dec 1996 00:00
slrn local spool "newgroups" timezone problem(?)
Author: Tony Galliford
Date: Mon, 02 Dec 1996 00:00
Date: Mon, 02 Dec 1996 00:00
42 lines
2238 bytes
2238 bytes
I've just compiled slrn for local spool support (been using with
nntp via loopback for months), and have found a problem with the
check for new newsgroups. New newsgroups are being repeadedly
marked as "new", even after they've been subscribed and read,
but only for about 20 hours, after which they revert to normal.
I dug through the code in spool.c, and noticed what appears to
be a logical error in the timezone correction. As far as I can
figure, this shouldn't be noticeable to people in a timezone
west of GMT, but to people east of GMT, new newsgroups would
keep appearing for a length of time equal to *twice* the
difference between their timezone and GMT. I think this is
because the time is adjusted in the wrong direction by the
mktime function (in the line removed in the patch below).
Anyway, this patch fixes the problem for me. Can anyone see
anything wrong with this? I notice even the original author
wasn't sure :-)
-----------------CUT HERE---------------
--- spool.c.orig Mon Dec 2 21:44:48 1996
+++ spool.c Mon Dec 2 21:44:11 1996
@@ -369,7 +369,7 @@
if (fGMT)
{
- threshold=mktime(gmtime(&threshold)); /* !HACK! is this correct? */
+ threshold-=timezone;
#if DEBUG_SPOOL
spool_debug ("threshold (GMT) = %d",threshold);
#endif
-----------------CUT HERE---------------
Tony.
--
Tony Galliford _--_|\ Murphy's Law is recursive --
Adelaide, Australia / \
Email: \_.--*_/ washing your car to make
gallto@amy.apana.org.au v it rain doesn't work.
Re: slrn local spool "newgroups" timezone problem(?)
Author: Olly Betts
Date: Thu, 12 Dec 1996 00:00
Date: Thu, 12 Dec 1996 00:00
34 lines
1895 bytes
1895 bytes
[Sorry about the slow reply -- I've been too busy recently to read much news. Thanks to John Davis for bringing this post to my attention] In article <slrn5a5fob.11f.gallto@amy.apana.org.au>, Tony Galliford wrote: >I've just compiled slrn for local spool support [...] >New newsgroups are being repeadedly >marked as "new", even after they've been subscribed and read, >but only for about 20 hours, after which they revert to normal. > >I dug through the code in spool.c, and noticed what appears to >be a logical error in the timezone correction. [...] >the time is adjusted in the wrong direction by the >mktime function (in the line removed in the patch below). > >Anyway, this patch fixes the problem for me. Can anyone see >anything wrong with this? I notice even the original author >wasn't sure :-) I'm the original author (in the UK you'll note), and indeed I wasn't completely sure. !HACK! is a "magic cookie" I use to flag things which require attention. >- threshold=mktime(gmtime(&threshold)); /* !HACK! is this correct? */ >+ threshold-=timezone; That sounds reasonable. I was trying to avoid using timezone since it isn't available in ANSI C. However, since my version doesn't work, that's rather an irrelevant advantage. Cheers, Olly
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