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

Comparing cvsroot/Coro/myhttpd/diridx.pl (file contents):
Revision 1.37 by root, Sun Jan 24 14:19:28 2010 UTC vs.
Revision 1.38 by root, Mon Mar 8 07:38:21 2010 UTC

1package main;
2
1use List::Util qw(sum); 3use List::Util qw(sum);
2 4
3use Coro::AIO (); 5use Coro::AIO ();
4use Storable (); 6use Storable ();
5 7
20sub conn::gen_statdata { 22sub conn::gen_statdata {
21 my $self = shift; 23 my $self = shift;
22 my $data; 24 my $data;
23 25
24 { 26 {
25 my $path = ""; 27 my $prefix = "http://" . $self->server_hostport;
26 my $prefix = ""; 28 my $path = "<a href='$prefix/'>$prefix</a> / ";
27 29
28 for ("http://".$self->server_hostport, split /\//, substr $self->{name}, 1) { 30 for (split /\//, substr $self->{name}, 1) {
29 next if $_ eq "."; 31 next if $_ eq ".";
32 $prefix .= "/" . escape_uri $_;
30 $path .= "<a href='".escape_uri("$prefix$_")."/'>$_</a> / "; 33 $path .= "<a href='$prefix/'>$_</a> / ";
31 $prefix .= "$_/";
32 } 34 }
33 $data->{path} = $path; 35 $data->{path} = $path;
34 } 36 }
35 37
36 { 38 {
171 $col = 0; 173 $col = 0;
172 } 174 }
173 if ("$self->{path}$_" =~ $conn::blockuri{$self->{country}}) { 175 if ("$self->{path}$_" =~ $conn::blockuri{$self->{country}}) {
174 $stat .= "<td>$_ "; 176 $stat .= "<td>$_ ";
175 } else { 177 } else {
176 $stat .= "<td><a href='".escape_uri("$_/")."'>$_</a> "; 178 $stat .= "<td><a href='".escape_uri($_)."/'>$_</a> ";
177 } 179 }
178 } 180 }
179 $stat .= "</table>"; 181 $stat .= "</table>";
180 } 182 }
181 if ($data->{flen}) { 183 if ($data->{flen}) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines