[svn:qpsmtpd] rev 393 - in branches/high_perf: . lib/Danga plugins

[email protected] 9 Mar 2005 00:28:50 -0000
Newsgroups perl.cvs.qpsmtpd
Message-ID <[email protected]>
Author: ask
Date: Tue Mar  8 16:28:49 2005
New Revision: 393

Modified:
   branches/high_perf/lib/Danga/DNS.pm
   branches/high_perf/plugins/check_earlytalker
   branches/high_perf/qpsmtpd
Log:
tweaks to make it work with tcpserver 

the check_earlytalker fix was entirely wrong


Modified: branches/high_perf/lib/Danga/DNS.pm
==============================================================================
--- branches/high_perf/lib/Danga/DNS.pm	(original)
+++ branches/high_perf/lib/Danga/DNS.pm	Tue Mar  8 16:28:49 2005
@@ -15,7 +15,7 @@
 
 sub trace {
     my $level = shift;
-    print ("[$$] dns lookup: @_") if $::DEBUG >= $level;
+    print STDERR ("[$$] dns lookup: @_") if $::DEBUG >= $level;
 }
 
 sub new {
@@ -93,7 +93,7 @@
     my $now = time;
     foreach my $host (@{$self->{hosts}}) {
         if (!$self->{results}{$host}) {
-            print "DNS timeout (presumably) looking for $host after " . ($now - $self->{start}) . " secs\n";
+            print STDERR "DNS timeout (presumably) looking for $host after " . ($now - $self->{start}) . " secs\n";
             $self->{callback}->("NXDOMAIN", $host);
         }
     }

Modified: branches/high_perf/plugins/check_earlytalker
==============================================================================
--- branches/high_perf/plugins/check_earlytalker	(original)
+++ branches/high_perf/plugins/check_earlytalker	Tue Mar  8 16:28:49 2005
@@ -71,7 +71,7 @@
 sub connect_handler {
   my ($self, $transaction) = @_;
 
-  if ($self->can_read($self->{_args}->{'wait'})) {
+  if ($self->qp->can_read($self->{_args}->{'wait'})) {
     $self->log(LOGNOTICE, 'remote host started talking before we said hello');
     if ($self->{_args}->{'defer-reject'}) {
 	$self->connection->notes('earlytalker', 1);

Modified: branches/high_perf/qpsmtpd
==============================================================================
--- branches/high_perf/qpsmtpd	(original)
+++ branches/high_perf/qpsmtpd	Tue Mar  8 16:28:49 2005
@@ -9,7 +9,8 @@
 
 use strict;
 use vars qw($DEBUG);
-use FindBin;
+use FindBin qw();
+# TODO: need to make this taint friendly
 use lib "$FindBin::Bin/lib";
 use Danga::Socket;
 use Danga::Client;
@@ -94,7 +95,7 @@
 my $server;
 
 # Code for inetd/tcpserver mode
-if ($ENV{REMOTE_HOST}) {
+if ($ENV{REMOTE_HOST} or $ENV{TCPREMOTEHOST}) {
     run_as_inetd();
     exit(0);
 }