/[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 199 by dpavlin, Tue Aug 11 15:13:19 2009 UTC revision 207 by dpavlin, Wed Aug 12 22:56:45 2009 UTC
# Line 50  use kvm; Line 50  use kvm;
50  use browser;  use browser;
51  use network;  use network;
52    
53    use CouchDB;
54    
55  sub static {  sub static {
56          my ($client,$path) = @_;          my ($client,$path) = @_;
# Line 61  sub static { Line 62  sub static {
62          if ( my $pid = fork ) {          if ( my $pid = fork ) {
63                  # parent                  # parent
64                  close($client);                  close($client);
                 print "http static child $pid\n";  
65                  $static_pids->{$pid} = $path;                  $static_pids->{$pid} = $path;
66                    CouchDB::audit('static', 'parent', { pid => $pid, path => $path });
67                  return 1;                  return 1;
68          }          }
69    
# Line 81  sub static { Line 82  sub static {
82          my $buff;          my $buff;
83          my $pos = 0;          my $pos = 0;
84    
85          warn "static $path $type $size block: $block\n";          CouchDB::audit( 'static', 'child', { pid => $$, path => $path, type => $type, size => $size, block => $block });
86    
87          progress_bar::start;          progress_bar::start;
88    
# Line 96  sub static { Line 97  sub static {
97    
98          print STDERR "\n";          print STDERR "\n";
99    
100          warn "exit static child";          CouchDB::audit( 'static', 'child', 'exit', { pid => $$ } );
101    
102          exit(0);          exit(0);
103  }  }
# Line 116  sub get_request { Line 117  sub get_request {
117    
118          server->refresh;          server->refresh;
119    
120          warn "get_request $path ", $param ? dump( $param ) : '', "\n";          CouchDB::audit( 'request', { path => $path, param => $param } );
121    
122          if ( my $found = static( $client,$path ) ) {          if ( my $found = static( $client,$path ) ) {
123                  warn "static $found" if $debug;                  warn "static $found" if $debug;
# Line 189  sub get_request { Line 190  sub get_request {
190                          ;                          ;
191          } elsif ( $path =~ m!^/client(?:/$RE{net}{IPv4}{-keep})?! ) {          } elsif ( $path =~ m!^/client(?:/$RE{net}{IPv4}{-keep})?! ) {
192                  my $ip = $1 || $client->peerhost;                  my $ip = $1 || $client->peerhost;
193    
194                    if ( my $new_ip = $param->{change_ip} ) {
195                            client::change_ip( $ip, $new_ip );
196                            $ip = $new_ip;
197                    }
198    
199                  if ( $ip ne $server::ip ) {                  if ( $ip ne $server::ip ) {
200                          my $hostname = client::conf( $ip, 'hostname' => $param->{hostname} );                          my $hostname = client::conf( $ip, 'hostname' => $param->{hostname} );
201    

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

  ViewVC Help
Powered by ViewVC 1.1.26