/[Sack]/trunk/lib/Sack/Server.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 /trunk/lib/Sack/Server.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 218 by dpavlin, Sun Nov 22 15:31:38 2009 UTC revision 219 by dpavlin, Sun Nov 22 21:54:25 2009 UTC
# Line 89  while (1) { Line 89  while (1) {
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 {
# Line 127  while (1) { Line 126  while (1) {
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 ) };

Legend:
Removed from v.218  
changed lines
  Added in v.219

  ViewVC Help
Powered by ViewVC 1.1.26