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) = @_; |
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 |
return 1; |
return 1; |
67 |
} |
} |
81 |
my $buff; |
my $buff; |
82 |
my $pos = 0; |
my $pos = 0; |
83 |
|
|
84 |
warn "static $path $type $size block: $block\n"; |
CouchDB::audit( 'static', { pid => $$, path => $path, type => $type, size => $size, block => $block, peerhost => $client->peerhost }); |
85 |
|
|
86 |
progress_bar::start; |
progress_bar::start; |
87 |
|
|
96 |
|
|
97 |
print STDERR "\n"; |
print STDERR "\n"; |
98 |
|
|
|
warn "exit static child"; |
|
|
|
|
99 |
exit(0); |
exit(0); |
100 |
} |
} |
101 |
|
|
114 |
|
|
115 |
server->refresh; |
server->refresh; |
116 |
|
|
117 |
warn "get_request $path ", $param ? dump( $param ) : '', "\n"; |
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; |