/[pxelator]/lib/PXElator/tftpd.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/tftpd.pm

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

revision 472 by dpavlin, Tue Jan 5 00:25:34 2010 UTC revision 482 by dpavlin, Sat Jan 23 18:31:14 2010 UTC
# Line 6  use strict; Line 6  use strict;
6  use Net::TFTPd 0.03 qw(%OPCODES);  use Net::TFTPd 0.03 qw(%OPCODES);
7  use IO::Socket::INET;  use IO::Socket::INET;
8  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
9  use CouchDB;  use store;
10    
11  use server;  use server;
12    
# Line 62  sub tftp_request { Line 62  sub tftp_request {
62                  path => $file,                  path => $file,
63                  state => 'start',                  state => 'start',
64          };          };
65          CouchDB::audit( $opcode, $audit );          store::audit( $opcode, $audit );
66    
67          progress_bar::start;          progress_bar::start;
68    
# Line 71  sub tftp_request { Line 71  sub tftp_request {
71                  my $size = -s "$dir/$file";                  my $size = -s "$dir/$file";
72                  $audit->{state} = 'finish';                  $audit->{state} = 'finish';
73                  $audit->{size} = $size;                  $audit->{size} = $size;
74                  CouchDB::audit( $opcode, $audit );                  store::audit( $opcode, $audit );
75          } else {          } else {
76                  $audit->{state} = 'error';                  $audit->{state} = 'error';
77                  $audit->{error} = Net::TFTPd->error;                  $audit->{error} = Net::TFTPd->error;
78                  CouchDB::audit( $opcode, $audit );                  store::audit( $opcode, $audit );
79          }          }
80    
81  }  }
# Line 118  sub start { Line 118  sub start {
118    
119          warn 'listener: ',dump( $listener ) if $debug;          warn 'listener: ',dump( $listener ) if $debug;
120    
121          CouchDB::audit( 'start', {          store::audit( 'start', {
122                  addr => $listener->{LocalAddr},                  addr => $listener->{LocalAddr},
123                  port => $listener->{LocalPort},                  port => $listener->{LocalPort},
124                  timeout => $listener->{Timeout},                  timeout => $listener->{Timeout},

Legend:
Removed from v.472  
changed lines
  Added in v.482

  ViewVC Help
Powered by ViewVC 1.1.26