Package: mutt-patched Version: 1.5.23-1.0.1 Severity: normal Tags: upstream, patch
Hello, I used to use an old version of mutt and the NNTP patch, but recently the NNTP patch was added to Debian's mutt-patched package so I decided to update and use that instead. My main use case is reading gmane.linux.kernel via news.gmane.org (a newsgroup with millions of messages) and mutt-patched takes ages to open that newsgroup. I had problems with LISTGROUP in the past [1], so I tried disabling it just as I did with the old version, because, well, it does seem like a really bad idea to LISTGROUP a newsgroup with millions of messages. Doing this the naive way broke header caching, since any gap in the sequence of message numbers triggers immediate XOVER for the rest of them. This happens a lot on gmane. So I implemented a simple heuristic -- skip the gaps if there are cached headers with greater message ids and use XOVER only for the last "gap" with no cached messages following it. This seems to work fairly well on gmane, but I have no idea whether it's safe in general. (It seems worth mentioning that the old version of the patch that used its own header caching mechanism did exactly that, which is why it worked for me all those years.) [1] http://thread.gmane.org/gmane.discuss/12188/ I'm no expert on NNTP, so I'll leave it at that. The patch author is Cc'd. Thanks. :-) -- System Information: Debian Release: jessie/sid APT prefers testing APT policy: (980, 'testing'), (980, 'stable'), (500, 'unstable'), (500, 'stable'), (200, 'experimental') Architecture: i386 (x86_64) Foreign Architectures: amd64 Kernel: Linux 3.15.0-rc5-lis64+ (SMP w/4 CPU cores) Locale: LANG=cs_CZ.UTF-8, LC_CTYPE=cs_CZ.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages mutt-patched depends on: ii libassuan0 2.1.1-1 ii libc6 2.18-5 ii libcomerr2 1.42.9-3 ii libgnutls26 2.12.23-15 ii libgpg-error0 1.12-0.2 ii libgpgme11 1.4.3-0.1 ii libgssapi-krb5-2 1.12.1+dfsg-1 ii libidn11 1.28-2 ii libk5crypto3 1.12.1+dfsg-1 ii libkrb5-3 1.12.1+dfsg-1 ii libncursesw5 5.9+20140118-1 ii libsasl2-2 2.1.26.dfsg1-9 ii libtinfo5 5.9+20140118-1 ii libtokyocabinet9 1.4.48-2 ii mutt 1.5.23-1.0.1 mutt-patched recommends no packages. mutt-patched suggests no packages. -- no debconf information -- Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/
Index: mutt/nntp.c =================================================================== --- mutt.orig/nntp.c 2014-05-13 23:26:12.880828218 +0200 +++ mutt/nntp.c 2014-05-14 00:14:43.927504715 +0200 @@ -109,7 +109,7 @@ else if (!mutt_strcmp ("READER", buf)) { nserv->hasDATE = 1; - nserv->hasLISTGROUP = 1; + //nserv->hasLISTGROUP = 1; } else if (!mutt_strncmp ("AUTHINFO ", buf, 9)) { @@ -152,7 +152,7 @@ mutt_str_replace (&nserv->authenticators, buf); /* current mode is reader */ - if (nserv->hasLISTGROUP) + if (nserv->hasDATE) return 0; /* server is mode-switching, need to switch to reader mode */ @@ -191,11 +191,13 @@ if (mutt_strncmp ("500", buf, 3)) nserv->hasDATE = 1; +#if 0 if (mutt_socket_write (conn, "LISTGROUP\r\n") < 0 || mutt_socket_readln (buf, sizeof (buf), conn) < 0) return nntp_connect_error (nserv); if (mutt_strncmp ("500", buf, 3)) nserv->hasLISTGROUP = 1; +#endif if (mutt_socket_write (conn, "LIST NEWSGROUPS +\r\n") < 0 || mutt_socket_readln (buf, sizeof (buf), conn) < 0) @@ -1186,7 +1188,7 @@ char buf[HUGE_STRING]; int rc = 0; int oldmsgcount = ctx->msgcount; - anum_t current; + anum_t current, last_ok = first - 1; #ifdef USE_HCACHE void *hdata; #endif @@ -1304,7 +1306,7 @@ /* fallback to fetch overview */ else if (nntp_data->nserv->hasOVER || nntp_data->nserv->hasXOVER) - break; + continue; //break; /* fetch header from server */ else @@ -1378,8 +1380,12 @@ } if (current > nntp_data->lastLoaded) nntp_data->lastLoaded = current; + + last_ok = current; } + current = last_ok + 1; + /* fetch overview information */ if (current <= last && rc == 0) { char *cmd = nntp_data->nserv->hasOVER ? "OVER" : "XOVER";