/[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 544 by dpavlin, Sat Oct 9 13:34:37 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 101  sub start { Line 101  sub start {
101          my $listener = bless {          my $listener = bless {
102                  RootDir => $dir,                  RootDir => $dir,
103    
104                  ACKtimeout  => 4,                  ACKtimeout  => 1, # 4
105                  ACKretries  => 4,                  ACKretries  => 2, # 4
106                  Readable    => 1,                  Readable    => 1,
107                  Writable    => 0,                  Writable    => 0,
108                  Timeout => 3600,                  Timeout => 3600,
# 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.544

  ViewVC Help
Powered by ViewVC 1.1.26