Skip to content

Commit

Permalink
removed experimental status from Mojo::Util
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 4, 2011
1 parent 09d2c66 commit 4ea9de0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,6 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.

2.23 2011-11-04 00:00:00
- Changed semantics of get_line function in Mojo::Util.
- Removed experimental status from Mojo::Util.
- Updated jQuery to version 1.7.
- Improved documentation.
- Improved empty path element handling in Mojo::URL.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Headers.pm
Expand Up @@ -199,7 +199,7 @@ sub parse {
$self->{buffer} .= $chunk if defined $chunk;
my $headers = $self->{cache} ||= [];
my $max = $self->max_line_size;
while (defined(my $line = get_line $self->{buffer})) {
while (defined(my $line = get_line \$self->{buffer})) {

# Check line size limit
if (length $line > $max) {
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/Message/Request.pm
Expand Up @@ -326,8 +326,8 @@ sub _parse_start_line {
my $self = shift;

# Ignore any leading empty lines
my $line = get_line $self->{buffer};
$line = get_line $self->{buffer}
my $line = get_line \$self->{buffer};
$line = get_line \$self->{buffer}
while ((defined $line) && ($line =~ m/^\s*$/));
return unless defined $line;

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Message/Response.pm
Expand Up @@ -149,7 +149,7 @@ sub _parse_start_line {
}

# We have a full HTTP 1.0+ response line
return unless defined(my $line = get_line $self->{buffer});
return unless defined(my $line = get_line \$self->{buffer});
return $self->error('Bad response start line.')
unless $line =~ $START_LINE_RE;
$self->version($+{version});
Expand Down
10 changes: 5 additions & 5 deletions lib/Mojo/Util.pm
Expand Up @@ -370,12 +370,13 @@ sub encode {
}

sub get_line {
my $string = shift;

# Locate line ending
return if (my $pos = index $_[0], "\x0a") == -1;
return if (my $pos = index $$string, "\x0a") == -1;

# Extract line and ending
my $line = substr $_[0], 0, $pos + 1, '';
my $line = substr $$string, 0, $pos + 1, '';
$line =~ s/\x0d?\x0a$//;

return $line;
Expand Down Expand Up @@ -677,7 +678,6 @@ Mojo::Util - Portable utility functions
=head1 DESCRIPTION
L<Mojo::Util> provides portable utility functions for L<Mojo>.
Note that this module is EXPERIMENTAL and might change without warning!
=head1 FUNCTIONS
Expand Down Expand Up @@ -727,9 +727,9 @@ Encode characters to bytes.
=head2 C<get_line>
my $line = get_line $chunk;
my $line = get_line \$string;
Extract a whole line from chunk or return undef.
Extract whole line from string or return C<undef>.
Lines are expected to end with C<0x0d 0x0a> or C<0x0a>.
=head2 C<hmac_md5_sum>
Expand Down

0 comments on commit 4ea9de0

Please sign in to comment.