From 452448749bb85c160eb32a5d3ed1ac3aaa6f74c7 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Tue, 29 Dec 1998 04:08:17 +0000 Subject: [PATCH] Implement variable news-group-cache-policy to control disk cacheing of news-group information. --- v7/src/edwin/edwin.pkg | 5 ++++- v7/src/edwin/nntp.scm | 24 ++++++++++++++++-------- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/v7/src/edwin/edwin.pkg b/v7/src/edwin/edwin.pkg index 212dd45eb..72fd00d78 100644 --- a/v7/src/edwin/edwin.pkg +++ b/v7/src/edwin/edwin.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: edwin.pkg,v 1.227 1998/12/29 02:35:29 cph Exp $ +$Id: edwin.pkg,v 1.228 1998/12/29 04:08:17 cph Exp $ Copyright (c) 1989-98 Massachusetts Institute of Technology @@ -1747,6 +1747,7 @@ MIT in each case. |# edwin-variable$news-group-keep-seen-headers edwin-variable$news-group-mode-hook edwin-variable$news-group-show-author-name + edwin-variable$news-group-show-cache-policy edwin-variable$news-group-show-context-headers edwin-variable$news-group-show-seen-headers edwin-variable$news-hide-groups @@ -1804,6 +1805,7 @@ MIT in each case. |# news-group:server news-group:server-info news-group:update-server-info! + news-group:use-gdbm? news-group? news-header:< news-header:field-value @@ -1844,6 +1846,7 @@ MIT in each case. |# organize-headers-into-threads set-news-group:reader-hook! set-news-group:server-info! + set-news-group:use-gdbm! set-news-header:reader-hook! set-news-thread:reader-hook! set-nntp-connection:reader-hook! diff --git a/v7/src/edwin/nntp.scm b/v7/src/edwin/nntp.scm index e5746e1e5..70a0c85f6 100644 --- a/v7/src/edwin/nntp.scm +++ b/v7/src/edwin/nntp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: nntp.scm,v 1.19 1998/06/21 09:05:17 cph Exp $ +;;; $Id: nntp.scm,v 1.20 1998/12/29 04:07:48 cph Exp $ ;;; ;;; Copyright (c) 1995-98 Massachusetts Institute of Technology ;;; @@ -482,7 +482,8 @@ (%estimated-n-articles #f) (%first-article #f) (%last-article #f) - (reader-hook #f)) + (reader-hook #f) + (%use-gdbm? 'UNDECIDED)) (define (make-news-group connection name) (or (find-news-group connection name) @@ -519,7 +520,7 @@ (define (news-group:last-article group) (and (news-group:active? group) (news-group:%last-article group))) - + (define (news-group:update-server-info! group) (set-news-group:server-info! group @@ -547,6 +548,13 @@ (vector (news-group:%estimated-n-articles group) (news-group:%first-article group) (news-group:%last-article group)))) + +(define (news-group:use-gdbm? group type) + (and (gdbm-available?) + (memq type (news-group:%use-gdbm? group)))) + +(define (set-news-group:use-gdbm! group types) + (set-news-group:%use-gdbm?! group types)) ;;;; Header Cache @@ -629,7 +637,7 @@ (lambda (headers numbers) (cond ((null? numbers) headers) - ((gdbm-available?) + ((news-group:use-gdbm? group 'HEADERS) (news-group:headers-gdbm group numbers headers ignore?)) (else (news-group:headers-no-gdbm group numbers headers ignore?)))))) @@ -710,7 +718,7 @@ (if gdbf (if (eq? 'UNAVAILABLE gdbf) #f gdbf) (let ((gdbf - (and (gdbm-available?) + (and (news-group:use-gdbm? group 'HEADERS) (let ((pathname (news-group:header-gdbf-pathname group))) (guarantee-init-file-directory pathname) @@ -788,7 +796,7 @@ (if gdbf (if (eq? 'UNAVAILABLE gdbf) #f gdbf) (let ((gdbf - (and (gdbm-available?) + (and (news-group:use-gdbm? group 'BODIES) (let ((pathname (news-group:body-gdbf-pathname group))) (guarantee-init-file-directory pathname) @@ -825,7 +833,7 @@ (nntp-body-command (news-group:connection group) (news-header:message-id header) port)))) - + (define (news-header:pre-read-body header) (let ((group (news-header:group header))) (let ((gdbf (news-group:body-gdbf group #t))) @@ -865,7 +873,7 @@ datum))))) (define (news-group:purge-pre-read-headers group predicate) - (if (gdbm-available?) + (if (news-group:use-gdbm? group 'HEADERS) (if (eq? predicate 'ALL) (begin (set-news-group:%header-gdbf! group #f) -- 2.25.1