--- trunk/lib/Sack/Server.pm 2009/11/21 16:34:12 212 +++ trunk/lib/Sack/Server.pm 2009/11/22 15:31:38 213 @@ -16,6 +16,7 @@ use lib '/srv/Sack/lib'; use Sack::Merge; use Sack::Server::HTTP; +use Sack::Server::HTML; my @cloud; my $cloud_path = $ENV{CLOUD} || "etc/cloud"; @@ -92,7 +93,6 @@ } elsif ( $sock == $www ) { my $client = $www->accept; Sack::Server::HTTP::request( $client, sub { -warn "XXX callback ",dump( @_ ); my ( $send, $method, $param ) = @_; if ( $method =~ m{views} ) { @@ -101,13 +101,17 @@ Sack::Merge->clean; to_all { view => $code, path => $method }; print $send "HTTP/1.0 302 $method\r\nLocation: /\r\n\r\n"; - return; + return 1; } elsif ( $method =~ m{^/tmp/sack} ) { @shard_paths = glob "$method/*"; warn "loading shard $method from ", dump( @shard_paths ); to_all { load => $method }; print $send "HTTP/1.0 302 $method\r\nLocation: /\r\n\r\n"; - return; + return 1; + } elsif ( $method =~ m{^/out/(.+)} ) { + print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"; + Sack::Server::HTML::send_out( $send, Sack::Merge->out, $1, $param ); + return 1; } print $send "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n"; @@ -117,6 +121,12 @@ , qq|| ; + my $out = Sack::Merge->out; + print $send qq|

Results

| + ; + print $send '

Info

' . dump( $info ) . '
'; print $send qq|

Data