Skip to content

Commit

Permalink
return a true value to signal an error
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 2, 2015
1 parent 8a4622c commit 6ba2bcb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Mojo/Transaction/WebSocket.pm
Expand Up @@ -194,7 +194,7 @@ sub parse_frame {
}

# Check message size
$self->finish(1009) and return undef if $len > $self->max_websocket_size;
return 1 if $len > $self->max_websocket_size;

# Check if whole packet has arrived
$len += 4 if my $masked = $second & 0b10000000;
Expand Down Expand Up @@ -248,6 +248,7 @@ sub server_read {

$self->{read} .= $chunk // '';
while (my $frame = $self->parse_frame(\$self->{read})) {
$self->finish(1009) and last unless ref $frame;
$self->emit(frame => $frame);
}

Expand Down

0 comments on commit 6ba2bcb

Please sign in to comment.