changeset 67:8df5d52436a1

More work towards DroneBL support.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 18 Aug 2009 03:38:31 +0300
parents 42889eed0ce8
children bac5931b8312
files maltfilter
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/maltfilter	Tue Aug 18 03:21:30 2009 +0300
+++ b/maltfilter	Tue Aug 18 03:38:31 2009 +0300
@@ -518,15 +518,13 @@
 sub dronebl_process
 {
   return unless ($settings{"DRONEBL"} > 0);
-  return if ($settings{"DRY_RUN"});
 
   # Create submission data
   my $xml = "<?xml version=\"1.0\"?>\n<request key=\"".$settings{"DRONEBL_RPC_KEY"}."\">\n";
   my $entries = 0;
   while (my ($ip, $entry) = each(%dronebl)) {
     if ($entry->{"sent"} == 0 && $entry->{"tries"} < 3) {
-      $xml .= "<add ip=\"".$ip."\" type=\"1\" />\n";
-#      $xml .= "<add ip=\"".$ip."\" type=\"".$entry->{"type"}."\" />\n";
+      $xml .= "<add ip=\"".$ip."\" type=\"".$entry->{"type"}."\" />\n";
       $entries++;
     }
   }
@@ -534,10 +532,13 @@
 
   # Bait out if no entries to submit
   return unless ($entries > 0);
-  mlog(1, "[DroneBL] Trying to submit $entries entries.\n");
+  if ($settings{"DRY_RUN"}) {
+    mlog(1, "[DroneBL] Would submit $entries entries.\n");
+#    return;
+  } else {
+    mlog(1, "[DroneBL] Trying to submit $entries entries.\n");
+  }
 
-return;
-    
   # Submit via HTTP XML-RPC
   my $tmp = LWP::UserAgent->new;
   $tmp->agent("Maltfilter/".$progversion);