89 |
$session->{peerport}->{ $new->peerport } = $new; |
$session->{peerport}->{ $new->peerport } = $new; |
90 |
warn "[socket] connect\n"; |
warn "[socket] connect\n"; |
91 |
Storable::store_fd( { ping => 1 }, $new ); |
Storable::store_fd( { ping => 1 }, $new ); |
|
info 0 => 'ping', $new->peerport; |
|
92 |
} elsif ( $sock == $www ) { |
} elsif ( $sock == $www ) { |
93 |
my $client = $www->accept; |
my $client = $www->accept; |
94 |
Sack::Server::HTTP::request( $client, sub { |
Sack::Server::HTTP::request( $client, sub { |
126 |
, qq|</ul>| |
, qq|</ul>| |
127 |
; |
; |
128 |
|
|
129 |
print $send '<h1>Info</h1><pre>' . dump( $info ) . '</pre>'; |
print $send qq|<h1>Nodes</h1> |
130 |
|
<style type="text/css"> |
131 |
|
.forked { |
132 |
|
color: #f00; |
133 |
|
} |
134 |
|
|
135 |
|
.ping { |
136 |
|
color: #0f0; |
137 |
|
} |
138 |
|
</style> |
139 |
|
|, join("\n", map { |
140 |
|
my $class = join(' ', map { $_->[0] } @{ $info->{node}->{$_} }); |
141 |
|
qq|<span class="$class">$_</span>|; |
142 |
|
} sort keys %{ $info->{node} } ); |
143 |
|
|
144 |
print $send qq|<h1>Data</h1><ul>| |
print $send qq|<h1>Data</h1><ul>| |
145 |
, join("\n", map { qq|<li><a href="$_">$_</a>| } glob '/tmp/sack/*' ) |
, join("\n", map { qq|<li><a href="$_">$_</a>| } glob '/tmp/sack/*' ) |
146 |
, qq|</ul>| |
, qq|</ul>| |
147 |
; |
; |
148 |
|
|
149 |
|
print $send '<pre>', dump($info), '</pre>'; |
150 |
|
|
151 |
} ); |
} ); |
152 |
} else { |
} else { |
153 |
my $data = eval { Storable::fd_retrieve( $sock ) }; |
my $data = eval { Storable::fd_retrieve( $sock ) }; |