ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/myhttpd/diridx.pl
(Generate patch)

Comparing Coro/myhttpd/diridx.pl (file contents):
Revision 1.26 by root, Mon Dec 3 21:38:31 2001 UTC vs.
Revision 1.27 by root, Mon Dec 3 21:45:45 2001 UTC

229 ["download queue", $queue_file], 229 ["download queue", $queue_file],
230 ["other queue", $queue_index], 230 ["other queue", $queue_index],
231 ) { 231 ) {
232 my ($name, $queue) = @$_; 232 my ($name, $queue) = @$_;
233 my @waiters = $queue->waiters; 233 my @waiters = $queue->waiters;
234 $waiters[$_]{idx} = $_ + 1 for 0..$#waiters;
235
234 if (@waiters) { 236 if (@waiters) {
235 $content .= "<li>$name<br />".(scalar @waiters)." client(s); $queue->{started} downloads started;"; 237 $content .= "<li>$name<br />".(scalar @waiters)." client(s); $queue->{started} downloads started;";
236 238
237 $content .= "<p>Waiting time until download starts, estimated:<ul>"; 239 $content .= "<p>Waiting time until download starts, estimated:<ul>";
238 for ( 240 for (
256 258
257 @waiters = grep { $verbose || $_->{coro}{conn}{remote_id} eq $self->{remote_id} } @waiters; 259 @waiters = grep { $verbose || $_->{coro}{conn}{remote_id} eq $self->{remote_id} } @waiters;
258 if (@waiters) { 260 if (@waiters) {
259 $content .= "<table border='1' width='100%'><tr><th>#</th><th>Remote ID</th>". 261 $content .= "<table border='1' width='100%'><tr><th>#</th><th>Remote ID</th>".
260 "<th>CN</th><th>Size</th><th>Waiting</th><th>ETA</th><th>URI</th></tr>"; 262 "<th>CN</th><th>Size</th><th>Waiting</th><th>ETA</th><th>URI</th></tr>";
261 my $idx = 0;
262 for (@waiters) { 263 for (@waiters) {
263 my $conn = $_->{coro}{conn}; 264 my $conn = $_->{coro}{conn};
264 my $time = format_time ($::NOW - $_->{time}); 265 my $time = format_time ($::NOW - $_->{time});
265 my $eta = format_time ($queue->{avgspb} * $_->{size} - ($::NOW - $_->{time})); 266 my $eta = $queue->{avgspb} * $_->{size} - ($::NOW - $_->{time});
266
267 $idx++;
268 267
269 $content .= "<tr>". 268 $content .= "<tr>".
270 "<td align='right'>$idx</td>". 269 "<td align='right'>$_->{idx}</td>".
271 "<td>$conn->{remote_id}</td>". 270 "<td>$conn->{remote_id}</td>".
272 "<td>$conn->{country}</td>". 271 "<td>$conn->{country}</td>".
273 "<td align='right'>$_->{size}</td>". 272 "<td align='right'>$_->{size}</td>".
274 "<td align='right'>$time</td>". 273 "<td align='right'>$time</td>".
275 "<td align='right'>$eta</td>". 274 "<td align='right'>".($eta < 0 ? "<font color='red'>overdue</font>" : format_time $eta)."</td>".
276 "<td>".escape_html($conn->{name})."</td>". 275 "<td>".escape_html($conn->{name})."</td>".
277 "</tr>"; 276 "</tr>";
278 } 277 }
279 $content .= "</table></li>"; 278 $content .= "</table></li>";
280 } 279 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines