checkpoint

This commit is contained in:
Patrick Donelan 2010-04-06 22:48:41 -04:00
parent 9e535846d5
commit c0abcc3e4a
3 changed files with 78 additions and 33 deletions

View file

@ -90,18 +90,20 @@ sub print {
my $content = shift;
my $skipMacros = shift || !($self->session->http->getMimeType =~ /^text/);
WebGUI::Macro::process($self->session, \$content) unless $skipMacros;
# Initialise response body if it's empty
$self->session->response->body([]) if !$self->session->response->body;
my $body = $self->session->response->body;
if (ref $body ne 'ARRAY') {
Carp::carp("Response body is not an ARRAY, it's a " . ref $body);
return;
my $handle = $self->{_handle};
if (defined $handle) {
print $handle $content;
}
elsif ($self->session->response) {
if ($self->session->response->streaming) {
$self->session->response->stream_write($content);
} else {
}
}
else {
print $content;
}
push @{ $body }, $content;
# TODO - put in IO bound delayed response
}
#-------------------------------------------------------------------