/[pxelator]/lib/PXElator/dnsd.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/PXElator/dnsd.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 258 by dpavlin, Sun Aug 16 22:51:57 2009 UTC revision 259 by dpavlin, Tue Aug 18 22:02:11 2009 UTC
# Line 28  sub reply_handler { Line 28  sub reply_handler {
28          my ($qname, $qclass, $qtype, $peerhost,$query,$conn) = @_;          my ($qname, $qclass, $qtype, $peerhost,$query,$conn) = @_;
29          my ($rcode, @ans, @auth, @add);          my ($rcode, @ans, @auth, @add);
30    
         server->refresh;  
31          $debug = server::debug;          $debug = server::debug;
32    
33          CouchDB::audit( 'request', {          my $audit = {
34                  qname => $qname,                  qname => $qname,
35                  qclass => $qclass,                  qclass => $qclass,
36                  qtype => $qtype,                  qtype => $qtype,
37                  peerhost =>  $peerhost,                  peerhost =>  $peerhost,
38                  sockhost => $conn->{"sockhost"}                  sockhost => $conn->{"sockhost"},
39          });                  source => 'unknown',
40            };
41    
42          $query->print if $debug;          $query->print if $debug;
43    
# Line 46  sub reply_handler { Line 46  sub reply_handler {
46    
47          my $ttl = 3600;          my $ttl = 3600;
48    
         my $audit = { source => 'unknown' };  
   
49          if ( $local ) {          if ( $local ) {
50                  warn "local[$local] $qname $qtype";                  warn "local[$local] $qname $qtype";
51                  $rcode = "NOERROR";                  $rcode = "NOERROR";
# Line 102  warn "## ",dump( $ptr_cache ); Line 100  warn "## ",dump( $ptr_cache );
100  sub start {  sub start {
101          my $ns = Net::DNS::Nameserver->new(          my $ns = Net::DNS::Nameserver->new(
102                  LocalPort    => 53,                  LocalPort    => 53,
103                  ReplyHandler => \&reply_handler,                  ReplyHandler => sub {
104                            server->refresh;
105                            reply_handler(@_);
106                    },
107                  Verbose      => $debug,                  Verbose      => $debug,
108          ) || die "couldn't create nameserver object\n";          ) || die "couldn't create nameserver object\n";
109    

Legend:
Removed from v.258  
changed lines
  Added in v.259

  ViewVC Help
Powered by ViewVC 1.1.26