has read_length => (is => 'rw');
has read_position => (is => 'rw');
+has _prepared_write => (is => 'rw');
+
no Moose;
# Amount of data to read from input on each pass
=head2 $self->finalize_error($c)
-Output an apropriate error message, called if there's an error in $c
+Output an appropriate error message. Called if there's an error in $c
after the dispatch has finished. Will output debug messages if Catalyst
is in debug mode, or a `please come back later` message otherwise.
$name = "<h1>$name</h1>";
# Don't show context in the dump
- delete $c->req->{_context};
- delete $c->res->{_context};
+ $c->req->_clear_context;
+ $c->res->_clear_context;
# Don't show body parser in the dump
delete $c->req->{_body};
sub write {
my ( $self, $c, $buffer ) = @_;
- unless ( $self->{_prepared_write} ) {
+ unless ( $self->_prepared_write ) {
$self->prepare_write($c);
- $self->{_prepared_write} = 1;
+ $self->_prepared_write(1);
}
+ return 0 if !defined $buffer;
+
my $len = length($buffer);
my $wrote = syswrite STDOUT, $buffer;