X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=cmd%2Fdx.pl;h=3fd00e6bb1bce1a4e56169f231d3a378095f2331;hb=abbcfa7500858a2eba4135b0af5db9f3fca8d68e;hp=d8dd56cbbd7ee76bf0507242d3eea7d9d8ee1ead;hpb=cd5b993f99b52d3c3c51779e9ea1fa150232225e;p=spider.git diff --git a/cmd/dx.pl b/cmd/dx.pl index d8dd56cb..3fd00e6b 100644 --- a/cmd/dx.pl +++ b/cmd/dx.pl @@ -122,9 +122,11 @@ return (1, @out) unless $valid; my $ipaddr; -if ($self->conn->peerhost) { - my $addr = $self->conn->peerhost; +if ($self->conn && $self->conn->peerhost) { + my $addr = $self->hostname; $ipaddr = $addr unless !is_ipaddr($addr) || $addr =~ /^127\./ || $addr =~ /^::[0-9a-f]+$/; +} elsif ($self->inscript) { + $ipaddr = "script"; } # Store it here (but only if it isn't baddx)