/[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 211 by dpavlin, Sat Nov 21 16:12:18 2009 UTC revision 212 by dpavlin, Sat Nov 21 16:34:12 2009 UTC
# Line 94  while (1) { Line 94  while (1) {
94                          Sack::Server::HTTP::request( $client, sub {                          Sack::Server::HTTP::request( $client, sub {
95  warn "XXX callback ",dump( @_ );  warn "XXX callback ",dump( @_ );
96                                  my ( $send, $method, $param ) = @_;                                  my ( $send, $method, $param ) = @_;
97                                  print $send "HTTP/1.0 200 OK\r\nContent-Type: text/plain\r\n\r\n"  
98                                          , dump( $info )                                  if ( $method =~ m{views} ) {
99                                            warn "$method ", -s $method, " bytes";
100                                            my $code = read_file $method;
101                                            Sack::Merge->clean;
102                                            to_all { view => $code, path => $method };
103                                            print $send "HTTP/1.0 302 $method\r\nLocation: /\r\n\r\n";
104                                            return;
105                                    } elsif ( $method =~ m{^/tmp/sack} ) {
106                                            @shard_paths = glob "$method/*";
107                                            warn "loading shard $method from ", dump( @shard_paths );
108                                            to_all { load => $method };
109                                            print $send "HTTP/1.0 302 $method\r\nLocation: /\r\n\r\n";
110                                            return;
111                                    }
112    
113                                    print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n";
114    
115                                    print $send qq|<h1>Views</h1><ul>|
116                                            , join("\n", map { qq|<li><a href="$_">$_</a>| } glob '/srv/Sack/views/*/*.pl' )
117                                            , qq|</ul>|
118                                            ;
119    
120                                    print $send '<h1>Info</h1><pre>' . dump( $info ) . '</pre>';
121    
122                                    print $send qq|<h1>Data</h1><ul>|
123                                            , join("\n", map { qq|<li><a href="$_">$_</a>| } glob '/tmp/sack/*' )
124                                            , qq|</ul>|
125                                          ;                                          ;
126                          } );                          } );
127                  } else {                  } else {

Legend:
Removed from v.211  
changed lines
  Added in v.212

  ViewVC Help
Powered by ViewVC 1.1.26