/[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 105 by dpavlin, Fri Jul 31 23:22:05 2009 UTC revision 107 by dpavlin, Sat Aug 1 00:44:52 2009 UTC
# Line 78  sub static { Line 78  sub static {
78          my $last_t = $start_t;          my $last_t = $start_t;
79    
80          while( my $len = read $fh, $buff, $block ) {          while( my $len = read $fh, $buff, $block ) {
81                  syswrite $client,$buff;                  print $client $buff;
82                  $client->flush;                  $client->flush;
83                  $pos += $len;                  $pos += $len;
84                  my $t = time();                  my $t = time();
85                  next unless $t - $last_t > 0.75;                  next unless $t - $last_t > 0.75;
86                  $last_t = $t;                  $last_t = $t;
87                  my $speed = ( $pos ) / ( $t - $start_t );                  my $speed = ( $pos ) / ( $t - $start_t );
88                  printf STDERR "%s %d/%d %.2f%% %.2f K/s ETA %.1fs\r"                  printf STDERR "%s %d/%d %.2f%% %.2f K/s ETA %.1fs   \r"
89                          , $path, $pos                          , $path, $pos
90                          , $size, $pos * 100 / $size                          , $size, $pos * 100 / $size
91                          , $speed / 1024                          , $speed / 1024
# Line 97  sub static { Line 97  sub static {
97    
98          print STDERR "\n";          print STDERR "\n";
99    
100          exit;          warn "exit static child";
101    
102            exit(0);
103  }  }
104    
105  use boolean;  use boolean;

Legend:
Removed from v.105  
changed lines
  Added in v.107

  ViewVC Help
Powered by ViewVC 1.1.26