Package: sn
Version: 0.3.8-10
Severity: normal
Tags: patch

sn gets confused and never updates the .serial file for a newsgroup when
a server responds to "ARTICLE nnn" with "220 0 <message-id>".

snfetch.c:fetch() expects the response to "ARTICLE nnn" to be "220 nnn
<message-id>" and is confused by servers (such as news.virginmedia.com)
which say 0 instead of repeating nnn. (This behaviour is rfc-compliant;
rfc3977 section 6.2.1.2 states "the client MUST always be prepared for
zero to be specified")

The result of this confusion is that fetch() returns 0 and snfetch bails
out early, claiming that it has nothing new to fetch, even if it fetched
several new articles. The newsgroup .serial files in the spool are never
updated, and articles in later retrieval runs are constantly
redownloaded and presented as new as snexpire cleans them up.

This patch tries to fix fetch() to use the article number it asked for
earlier if 0 was returned by the server.

--- sn-0.3.8.orig/snfetch.c
+++ sn-0.3.8/snfetch.c
@@ -300,6 +300,8 @@
                badresponse("ARTICLE");
             case 220:
                last = strtoul(args[1], &end, 10);
+               if (last == 0)
+                  last = arts[n - p].serial;
                readprint();
                collected++;
                break;

-- 
http://rjy.org.uk/



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to