[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[leafnode-list] 1.9.20.rel: make fetchnews more robust
2002-03-29 Jonathan Larmour <jlarmour@xxxxxxxxxx>
* fetchnews.c (getgroup): Only reference fields when they're
non-NULL
Don't use maxage when 0.
* config.example: maxage==0 means disable.
I have a feature request too: that fetchnews should be able to retrieve the
entire article using ARTICLE, and not just using HEAD and BODY. One of my
upstream servers has a buggy implementation of the latter that returns
corrupt data (and I've complained :-|). Fortunately there's another I can
use, but others may be in the same position since evidently ISPs don't
check these things :-|.
Jifl
--
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine--- leafnode-1.9.20.rel.pristine/fetchnews.c Mon Mar 25 00:45:38 2002
+++ leafnode-1.9.20.rel/./fetchnews.c Fri Mar 29 16:40:42 2002
@@ -744,8 +744,8 @@ getgroup(struct newsgroup *g, long serve
stat(t = lookup(fields[h_mid]), &st) != 0) {
stufftoget[outstanding] = art;
outstanding++;
- if ((maxbytes && (strtol(fields[h_byt], 0, 10) > maxbytes))
- || (maxage && (age(fields[h_dat]) > maxage))
+ if ((maxbytes && fields[h_byt] && (strtol(fields[h_byt], 0, 10) > maxbytes))
+ || (maxage && fields[h_dat] && (age(fields[h_dat]) > maxage))
) {
killed++;
outstanding--;
@@ -934,7 +934,7 @@ getgroup(struct newsgroup *g, long serve
}
}
- if (age(hd[5]) > maxage) {
+ if (maxage && age(hd[5]) > maxage) {
if (verbose > 2)
printf("Discarding article %ld - older than %d days\n",
stufftoget[i], maxage);
--- leafnode-1.9.20.rel.pristine/config.example Sat Mar 23 23:42:36 2002
+++ leafnode-1.9.20.rel/./config.example Fri Mar 29 18:15:49 2002
@@ -81,8 +81,8 @@ expire = 20
## If you suffer from repeatedly receiving old postings (this happens
## sometimes when an upstream server goes into hiccup mode) you can
## refuse to receive them with the parameter "maxage" which tells the
-## maximum allowed age of an article in days. The default maxage is 10
-## days.
+## maximum allowed age of an article in days. A value of 0 indicates that
+## no checking should be performed. The default maxage is 10 days.
# maxage = 10
## maxlines will make fetch reject postings that are longer than a certain