/[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 207 by dpavlin, Wed Aug 12 22:56:45 2009 UTC revision 208 by dpavlin, Wed Aug 12 23:59:01 2009 UTC
# Line 58  sub tftp_request { Line 58  sub tftp_request {
58          my $file = $request->{'_REQUEST_'}{'FileName'};          my $file = $request->{'_REQUEST_'}{'FileName'};
59          my $opcode = $OPCODES{$request->{'_REQUEST_'}{'OPCODE'}};          my $opcode = $OPCODES{$request->{'_REQUEST_'}{'OPCODE'}};
60    
61          CouchDB::audit('request', {          my $audit = {
62                  ip => $ip,                  ip => $ip,
63                  opcode => $opcode,                  opcode => $opcode,
64                  file => $file,                  file => $file,
65          });                  state => 'start',
66            };
67            CouchDB::audit( $opcode, $audit );
68    
69          progress_bar::start;          progress_bar::start;
70    
71          # process the request          # process the request
72          if( $request->processRQ() ) {          if( $request->processRQ() ) {
73                  my $size = -s "$dir/$file";                  my $size = -s "$dir/$file";
74                  CouchDB::audit('completed', { file => $file, size => $size });                  $audit->{state} = 'finish';
75                    $audit->{size} = $size;
76                    CouchDB::audit( $opcode, $audit );
77          } else {          } else {
78                  CouchDB::audit('error', { file => $file, error => Net::TFTPd->error });                  $audit->{state} = 'error';
79                    $audit->{error} = Net::TFTPd->error;
80                    CouchDB::audit( $opcode, $audit );
81                  $request->processRQ();                  $request->processRQ();
82          }          }
83    

Legend:
Removed from v.207  
changed lines
  Added in v.208

  ViewVC Help
Powered by ViewVC 1.1.26