/[pxelator]/lib/PXElator/httpd.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/httpd.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 216 by dpavlin, Thu Aug 13 13:06:18 2009 UTC
# Line 63  sub static { Line 63  sub static {
63                  # parent                  # parent
64                  close($client);                  close($client);
65                  $static_pids->{$pid} = $path;                  $static_pids->{$pid} = $path;
                 CouchDB::audit('static', 'parent', { pid => $pid, path => $path });  
66                  return 1;                  return 1;
67          }          }
68    
# Line 82  sub static { Line 81  sub static {
81          my $buff;          my $buff;
82          my $pos = 0;          my $pos = 0;
83    
84          CouchDB::audit( 'static', 'child', { pid => $$, path => $path, type => $type, size => $size, block => $block });          CouchDB::audit( 'static', { pid => $$, path => $path, type => $type, size => $size, block => $block, peerhost => $client->peerhost });
85    
86          progress_bar::start;          progress_bar::start;
87    
# Line 97  sub static { Line 96  sub static {
96    
97          print STDERR "\n";          print STDERR "\n";
98    
         CouchDB::audit( 'static', 'child', 'exit', { pid => $$ } );  
   
99          exit(0);          exit(0);
100  }  }
101    
# Line 117  sub get_request { Line 114  sub get_request {
114    
115          server->refresh;          server->refresh;
116    
117          CouchDB::audit( 'request', { path => $path, param => $param } );          CouchDB::audit( 'request', { path => $path, param => $param, peerhost => $client->peerhost } );
118    
119          if ( my $found = static( $client,$path ) ) {          if ( my $found = static( $client,$path ) ) {
120                  warn "static $found" if $debug;                  warn "static $found" if $debug;
# Line 206  sub get_request { Line 203  sub get_request {
203    
204                          my $deploy;                          my $deploy;
205    
206                          if ( my $mac = client::mac( $ip ) ) {                          if ( my $mac = client::mac_from_ip( $ip ) ) {
207                                  $deploy = client::conf( $ip, 'deploy' => $param->{deploy} );                                  $deploy = client::conf( $ip, 'deploy' => $param->{deploy} );
208                                  push @table, (                                  push @table, (
209                                          'mac' => $mac,                                          'mac' => format::mac( $mac => 'html' ),
210                                          'deploy' => html::select( 'deploy', $deploy, config::available )                                          'deploy' => html::select( 'deploy', $deploy, config::available )
211                                  );                                  );
212                                  $deploy = qq|<h2>PXElinux</h2>| . html::pre( config::for_ip( $ip ) );                                  $deploy = qq|<h2>PXElinux</h2>| . html::pre( config::for_ip( $ip ) );
# Line 246  sub get_request { Line 243  sub get_request {
243                                          map {                                          map {
244                                                  my $ip = $_;                                                  my $ip = $_;
245                                                  $ip =~ s{^.+/ip/}{};                                                  $ip =~ s{^.+/ip/}{};
246                                                  my $arp = $arp->{ client::mac $ip, 'clean' };                                                  my $mac = client::mac_from_ip $ip;
247                                                    my $arp = $arp->{ $mac };
248                                                  $arp = $arp ? $arp->[1] : '';                                                  $arp = $arp ? $arp->[1] : '';
249                                                  $arp =~ s{$ip}{};                                                  $arp =~ s{$ip}{};
250                                                  (                                                  (
251                                                          qq|<a href=/client/$ip>$ip</a>|                                                          qq|<a href=/client/$ip>$ip</a>|
252                                                          , client::conf( $ip, 'hostname' )                                                          , client::conf( $ip, 'hostname' )
253                                                          , client::mac( $ip )                                                          , format::mac( $mac => 'html' )
254                                                          , html::tt( client::conf( $ip, 'deploy' ) )                                                          , html::tt( client::conf( $ip, 'deploy' ) )
255                                                          , $arp                                                          , $arp
256                                                  );                                                  );
# Line 263  sub get_request { Line 261  sub get_request {
261                                  , html::table( -3, 'mac', 'dev', 'ip',                                  , html::table( -3, 'mac', 'dev', 'ip',
262                                          map {                                          map {
263                                                  my $c = $arp->{$_};                                                  my $c = $arp->{$_};
264                                                  ( html::tt( $_ ), $c->[1], $c->[0] )                                                  ( format::mac( $_ => 'html' ), $c->[1], $c->[0] )
265                                          } sort keys %$arp                                          } sort keys %$arp
266                                  )                                  )
267                                  ;                                  ;

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

  ViewVC Help
Powered by ViewVC 1.1.26