You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2007/11/13 23:51:54 UTC

svn commit: r594689 - /spamassassin/trunk/masses/mass-check

Author: jm
Date: Tue Nov 13 14:51:53 2007
New Revision: 594689

URL: http://svn.apache.org/viewvc?rev=594689&view=rev
Log:
use SDBM_File instead of DB_File for caches; it should be faster, and always available, possibly at the expense of a little extra disk space

Modified:
    spamassassin/trunk/masses/mass-check

Modified: spamassassin/trunk/masses/mass-check
URL: http://svn.apache.org/viewvc/spamassassin/trunk/masses/mass-check?rev=594689&r1=594688&r2=594689&view=diff
==============================================================================
--- spamassassin/trunk/masses/mass-check (original)
+++ spamassassin/trunk/masses/mass-check Tue Nov 13 14:51:53 2007
@@ -181,7 +181,7 @@
 use constant HAS_IO_SOCKET_SSL => eval { require IO::Socket::SSL; };
 use Config; 
 use constant HAS_TIME_HI_RES => eval { require Time::HiRes; };
-use constant HAS_DB_FILE => eval { require DB_File; };
+use constant HAS_SDBM_FILE => eval { require SDBM_File; };
 
 
 # default settings
@@ -276,8 +276,8 @@
   warn '*'x74 ."\n";
 }
 
-if ($opt_cs_schedule_cache && !HAS_DB_FILE) {
-  warn "--cs_schedule_cache requires the Perl module DB_File.\n";
+if ($opt_cs_schedule_cache && !HAS_SDBM_FILE) {
+  warn "--cs_schedule_cache requires the Perl module SDBM_File.\n";
   exit;
 }
 
@@ -500,9 +500,9 @@
     push @cache_tmp_files, $dbpath;
 
     {
-      no strict; # DB_File is optional, avoid strict subs warnings
-      tie %{$server_caches{'to_process'}}, "DB_File", $dbpath,
-        DB_File::O_RDWR|DB_File::O_CREAT, 0600, $DB_File::DB_HASH ||
+      no strict; # SDBM_File is optional, avoid strict subs warnings
+      tie %{$server_caches{'to_process'}}, "SDBM_File", $dbpath,
+        SDBM_File::O_RDWR|SDBM_File::O_CREAT, 0600 ||
           die "Cannot tie hash to file $dbpath: $!";
     }
 
@@ -513,9 +513,9 @@
     push @cache_tmp_files, $dbpath;
   
     {
-      no strict; # DB_File is optional, avoid strict subs warnings
-      tie %{$server_caches{'not_cached'}}, "DB_File", $dbpath,
-        DB_File::O_RDWR|DB_File::O_CREAT, 0600, $DB_File::DB_HASH ||
+      no strict; # SDBM_File is optional, avoid strict subs warnings
+      tie %{$server_caches{'not_cached'}}, "SDBM_File", $dbpath,
+        SDBM_File::O_RDWR|SDBM_File::O_CREAT, 0600 ||
           die "Cannot tie hash to file $dbpath: $!";
     }
 
@@ -526,9 +526,9 @@
     push @cache_tmp_files, $dbpath;
 
     {
-      no strict; # DB_File is optional, avoid strict subs warnings
-      tie %{$server_caches{'cache_count'}}, "DB_File", $dbpath,
-        DB_File::O_RDWR|DB_File::O_CREAT, 0600, $DB_File::DB_HASH ||
+      no strict; # SDBM_File is optional, avoid strict subs warnings
+      tie %{$server_caches{'cache_count'}}, "SDBM_File", $dbpath,
+        SDBM_File::O_RDWR|SDBM_File::O_CREAT, 0600 ||
           die "Cannot tie hash to file $dbpath: $!";
     }
 
@@ -1229,9 +1229,9 @@
             push @cache_tmp_files, $dbpath;
 
             {
-              no strict; # DB_File is optional, avoid strict subs warnings
-              tie %{$client_caches{$headers->{'client-id'}}}, "DB_File", $dbpath,
-                DB_File::O_RDWR|DB_File::O_CREAT, 0600, $DB_File::DB_HASH ||
+              no strict; # SDBM_File is optional, avoid strict subs warnings
+              tie %{$client_caches{$headers->{'client-id'}}}, "SDBM_File", $dbpath,
+                SDBM_File::O_RDWR|SDBM_File::O_CREAT, 0600 ||
                   die "Cannot tie hash to file $dbpath: $!\n";
             }