Author: ask
Date: Mon May  5 10:05:38 2008
New Revision: 885

Modified:
   trunk/plugins/async/check_earlytalker
   trunk/plugins/check_earlytalker
   trunk/plugins/logging/file
   trunk/plugins/logging/syslog
   trunk/plugins/queue/exim-bsmtp
   trunk/plugins/uribl

Log:
s/txn/transaction/ and perltidy cleanup (Steve Kemp)

Modified: trunk/plugins/async/check_earlytalker
==============================================================================
--- trunk/plugins/async/check_earlytalker       (original)
+++ trunk/plugins/async/check_earlytalker       Mon May  5 10:05:38 2008
@@ -87,7 +87,7 @@
 
 sub check_talker_poll {
   my ($self, $transaction) = @_;
-  
+
   my $qp = $self->qp;
   my $conn = $qp->connection;
   my $check_until = time + $self->{_args}{'wait'};
@@ -97,7 +97,7 @@
 
 sub read_now {
   my ($qp, $conn, $until, $phase) = @_;
-  
+
   if ($qp->has_data) {
     $qp->log(LOGNOTICE, 'remote host started talking after $phase before we 
responded');
     $qp->clear_data if $phase eq 'data';
@@ -115,7 +115,7 @@
 
 sub check_talker_post {
   my ($self, $transaction) = @_;
-  
+
   my $conn = $self->qp->connection;
   return DECLINED unless $conn->notes('earlytalker');
   return DECLINED if $self->{'defer-reject'};
@@ -125,7 +125,7 @@
 }
 
 sub hook_mail {
-  my ($self, $txn) = @_;
+  my ($self, $transaction) = @_;
 
   return DECLINED unless $self->connection->notes('earlytalker');
   return (DENY,$MSG) if $self->{_args}->{'action'} eq 'deny';

Modified: trunk/plugins/check_earlytalker
==============================================================================
--- trunk/plugins/check_earlytalker     (original)
+++ trunk/plugins/check_earlytalker     Mon May  5 10:05:38 2008
@@ -102,7 +102,7 @@
 
 sub apr_connect_handler {
     my ($self, $transaction) = @_;
-    
+
     return DECLINED unless $self->{_args}{'check-at'}{CONNECT};
     return DECLINED if ($self->qp->connection->notes('whitelistclient'));
     my $ip = $self->qp->connection->remote_ip;
@@ -110,7 +110,7 @@
     my $c = $self->qp->{conn};
     my $socket = $c->client_socket;
     my $timeout = $self->{_args}->{'wait'} * 1_000_000;
-    
+
     my $rc = $socket->poll($c->pool, $timeout, APR::Const::POLLIN());
     if ($rc == APR::Const::SUCCESS()) {
         $self->log(LOGNOTICE, "remote host started talking before we said 
hello [$ip]");
@@ -130,7 +130,7 @@
 
 sub apr_data_handler {
     my ($self, $transaction) = @_;
-    
+
     return DECLINED unless $self->{_args}{'check-at'}{DATA};
     return DECLINED if ($self->qp->connection->notes('whitelistclient'));
     my $ip = $self->qp->connection->remote_ip;
@@ -138,7 +138,7 @@
     my $c = $self->qp->{conn};
     my $socket = $c->client_socket;
     my $timeout = $self->{_args}->{'wait'} * 1_000_000;
-    
+
     my $rc = $socket->poll($c->pool, $timeout, APR::Const::POLLIN());
     if ($rc == APR::Const::SUCCESS()) {
         $self->log(LOGNOTICE, "remote host started talking before we said 
hello [$ip]");
@@ -199,7 +199,7 @@
 }
 
 sub mail_handler {
-  my ($self, $txn) = @_;
+  my ($self, $transaction) = @_;
   my $msg = 'Connecting host started transmitting before SMTP greeting';
 
   return DECLINED unless $self->qp->connection->notes('earlytalker');

Modified: trunk/plugins/logging/file
==============================================================================
--- trunk/plugins/logging/file  (original)
+++ trunk/plugins/logging/file  Mon May  5 10:05:38 2008
@@ -183,9 +183,9 @@
 }
 
 sub log_output {
-    my ($self, $txn) = @_;
+    my ($self, $transaction) = @_;
     my $output = $self->{_log_format};
-    $output =~ s/%i/($txn->notes('logging-session-id') || 'parent')/ge;
+    $output =~ s/%i/($transaction->notes('logging-session-id') || 'parent')/ge;
     $output = strftime $output, localtime;
     $output;
 }
@@ -216,28 +216,28 @@
 #
 # Returns true if the file was reopened, zero if not, undef on error.
 sub maybe_reopen {
-    my ($self, $txn) = @_;
+    my ($self, $transaction) = @_;
 
-    my $new_output = $self->log_output($txn);
+    my $new_output = $self->log_output($transaction);
     if (!$self->{_current_output} ||
         $self->{_current_output} ne $new_output ||
         ($self->{_reopen} &&
-         !$txn->notes('file-reopened-this-session'))) {
-        unless ($self->open_log($new_output, $txn)) {
+         !$transaction->notes('file-reopened-this-session'))) {
+        unless ($self->open_log($new_output, $transaction)) {
             return undef;
         }
-        $txn->notes('file-reopened-this-session', 1);
+        $transaction->notes('file-reopened-this-session', 1);
         return 1;
     }
     return 0;
 }
 
 sub hook_connect {
-    my ($self, $txn) = @_;
+    my ($self, $transaction) = @_;
 
-    $txn->notes('file-logged-this-session', 0);
-    $txn->notes('file-reopened-this-session', 0);
-    $txn->notes('logging-session-id',
+    $transaction->notes('file-logged-this-session', 0);
+    $transaction->notes('file-reopened-this-session', 0);
+    $transaction->notes('logging-session-id',
                 sprintf("%08d-%04d-%d",
                         scalar time, $$, ++$self->{_session_counter}));
     return DECLINED;
@@ -253,7 +253,7 @@
 }
 
 sub hook_logging {
-    my ($self, $txn, $trace, $hook, $plugin, @log) = @_;
+    my ($self, $transaction, $trace, $hook, $plugin, @log) = @_;
 
     return DECLINED if !defined $self->{_loglevel} or
                        $trace > $self->{_loglevel};
@@ -265,11 +265,11 @@
     # - We haven't logged anything yet this session
     if (!$self->{_f} ||
         !$self->{_nosplit} ||
-        !$txn->notes('file-logged-this-session')) {
-        unless (defined $self->maybe_reopen($txn)) {
+        !$transaction->notes('file-logged-this-session')) {
+        unless (defined $self->maybe_reopen($transaction)) {
             return DECLINED;
         }
-        $txn->notes('file-logged-this-session', 1);
+        $transaction->notes('file-logged-this-session', 1);
     }
 
     my $f = $self->{_f};

Modified: trunk/plugins/logging/syslog
==============================================================================
--- trunk/plugins/logging/syslog        (original)
+++ trunk/plugins/logging/syslog        Mon May  5 10:05:38 2008
@@ -61,7 +61,7 @@
 syslog(3) log levels of their corresponding names.  This will cause various
 messages to appear or not in syslog outputs according to your syslogd
 configuration (typically /etc/syslog.conf).  However, if the B<priority>
-setting is used, all messages will be logged at that priority regardless of 
+setting is used, all messages will be logged at that priority regardless of
 what the original priority might have been.
 
 =item B<ident>
@@ -141,7 +141,7 @@
             $self->{_priority} = $1;
         }
     }
-    
+
     if ($args{ident} && $args{ident} =~ /^([\w\-.]+)$/) {
         $ident = $1;
     }
@@ -172,7 +172,7 @@
 );
 
 sub hook_logging {
-    my ($self, $txn, $trace, $hook, $plugin, @log) = @_;
+    my ($self, $transaction, $trace, $hook, $plugin, @log) = @_;
 
     return DECLINED if $trace > $self->{_loglevel};
     return DECLINED if defined $plugin and $plugin eq $self->plugin_name;

Modified: trunk/plugins/queue/exim-bsmtp
==============================================================================
--- trunk/plugins/queue/exim-bsmtp      (original)
+++ trunk/plugins/queue/exim-bsmtp      Mon May  5 10:05:38 2008
@@ -78,7 +78,7 @@
 }
 
 sub hook_queue {
-    my ($self, $txn) = @_;
+    my ($self, $transaction) = @_;
 
     my $tmp_dir = $self->qp->config('spool_dir') || '/tmp';
     $tmp_dir = $1 if ($tmp_dir =~ /(.*)/);
@@ -89,12 +89,12 @@
     }
 
     print $tmp "HELO ", hostname(), "\n",
-               "MAIL FROM:<", ($txn->sender->address || ''), ">\n";
+               "MAIL FROM:<", ($transaction->sender->address || ''), ">\n";
     print $tmp "RCPT TO:<", ($_->address || ''), ">\n"
-      for $txn->recipients;
-    print $tmp "DATA\n", $txn->header->as_string;
-    $txn->body_resetpos;
-    while (my $line = $txn->body_getline) {
+      for $transaction->recipients;
+    print $tmp "DATA\n", $transaction->header->as_string;
+    $transaction->body_resetpos;
+    while (my $line = $transaction->body_getline) {
       $line =~ s/^\./../;
       print $tmp $line;
     }
@@ -107,7 +107,7 @@
     unless ($exim) {
         $self->log(LOGERROR, "Could not execute $self->{_exim_path}: $!");
         unlink $tmpfn or $self->log(LOGERROR, "unlink: $tmpfn: $!");
-        return (DECLINED, "Internal error enqueuing mail"); 
+        return (DECLINED, "Internal error enqueuing mail");
     }
     # Normally exim produces no output in BSMTP mode; anything that
     # does come out is an error worth logging.

Modified: trunk/plugins/uribl
==============================================================================
--- trunk/plugins/uribl (original)
+++ trunk/plugins/uribl Mon May  5 10:05:38 2008
@@ -215,7 +215,7 @@
         if (defined $s1) {
             $self->{sockets}->{$z}->{$name}->{'txt'} = $s1;
             $self->{socket_select}->add($s1);
-            $self->{socket_idx}->{"$s1"} = 
+            $self->{socket_idx}->{"$s1"} =
             $self->{socket_idx}->{"$s1"} = $index;
             $count++;
         } else {
@@ -251,18 +251,18 @@
 }
 
 sub data_handler {
-    my ($self, $txn) = @_;
+    my ($self, $transaction) = @_;
     my $l;
     my $queries = 0;
     my %pending;
     my @qp_continuations;
 
-    $txn->body_resetpos;
-    while ($self->{check_headers} and $l = $txn->body_getline) {
+    $transaction->body_resetpos;
+    while ($self->{check_headers} and $l = $transaction->body_getline) {
         chomp $l;
         last if !$l;
     }
-    while ($l = $txn->body_getline) {
+    while ($l = $transaction->body_getline) {
         chomp $l;
 
                 if ($l =~ /(.*)=$/) {
@@ -378,7 +378,7 @@
             }
         }
     }
-    $txn->body_resetpos;
+    $transaction->body_resetpos;
 
     unless ($queries) {
         $self->log(LOGINFO, "No URIs found in mail");
@@ -448,7 +448,7 @@
     for (@matches) {
         $self->log(LOGWARN, $_->{desc});
         if ($_->{action} eq 'add-header') {
-            $txn->header->add('X-URIBL-Match', $_->{desc});
+            $transaction->header->add('X-URIBL-Match', $_->{desc});
         } elsif ($_->{action} eq 'deny') {
             return (DENY, $_->{desc});
         } elsif ($_->{action} eq 'denysoft') {

Reply via email to