Tis file documents the revision history for Perl extension Catalyst.
5.50
+ - Added prepare_body_chunk method as a hook for upload progress.
- Fixed bug in uri_for method when base has no path.
5.49_01 2005-10-10 10:15:00
}
}
+=item $c->prepare_body_chunk( $chunk )
+
+Prepare a chunk of data before sending it to HTTP::Body.
+
+=cut
+
+sub prepare_body_chunk {
+ my $c = shift;
+ $c->engine->prepare_body_chunk( $c, @_ );
+}
+
=item $c->prepare_body_parameters
Prepare body parameters.
# Stringify to class
use overload '""' => sub { return ref shift }, fallback => 1;
+# Amount of data to read from input on each pass
+our $CHUNKSIZE = 4096;
+
=head1 NAME
Catalyst::Engine - The Catalyst Engine
if ( $self->read_length > 0 ) {
while ( my $buffer = $self->read( $c ) ) {
- $c->request->{_body}->add( $buffer );
+ $c->prepare_body_chunk( $buffer );
}
}
}
+=item $self->prepare_body_chunk($c)
+
+=cut
+
+sub prepare_body_chunk {
+ my ( $self, $c, $chunk ) = @_;
+
+ $c->request->{_body}->add( $chunk );
+}
+
=item $self->prepare_body_parameters($c)
=cut
}
my $remaining = $self->read_length - $self->read_position;
- $maxlength ||= $self->read_length;
+ $maxlength ||= $CHUNKSIZE;
# Are we done reading?
if ( $remaining <= 0 ) {