🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #28026

slrn local spool "newgroups" timezone problem(?)

#28026
From: Tony Galliford
Date: Mon, 02 Dec 1996 00:00
42 lines
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.

Technical Details
Message-ID: <slrn5a5fob.11f.gallto@amy.apana.org.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <slrn5a5fob.11f.gallto@amy.apana.org.au>
Subject: slrn local spool "newgroups" timezone problem(?)
Date: Mon, 02 Dec 1996 00:00:00 +0000
From: gallto@amy.apana.org.au (Tony Galliford)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail
X-Deja-AN: 201856123
Organization: Another dead end on the digital dirt-track
X-licence: This article remains the property of the author and may
Reply-to: gallto@amy.apana.org.au
Newsgroups: news.software.readers