Skip to content

Commit

Permalink
Fix comments and trace message: more clear now
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Melo <melo@simplicidade.org>
  • Loading branch information
melo committed Jan 21, 2010
1 parent baaf956 commit 4757e92
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions protocol-amqp/lib/Protocol/AMQP/Peer.pm
Expand Up @@ -90,7 +90,7 @@ sub _on_connect_ok {
$self->_send_protocol_header;

## FIXME: this is too soon, it should be after the Connection.Tune_Ok
## Only temporary to make sure our tests end
## Only temporary to make sure our tests end properly
$self->user_on_connect_cb();

return;
Expand All @@ -100,7 +100,7 @@ sub _on_connect_ok {
sub _on_read {
my ($self, $bref) = @_;

## No parser? we are skipping until EOF
## If no parser, we are skipping reads until EOF
$$bref = '', return unless $self->{parser};

my $parser;
Expand All @@ -120,7 +120,7 @@ sub _send_protocol_header {
my $v = $self->_pick_best_protocol_version;
my $protocol_header =
pack('a* C CCC', "AMQP", 0, $v->{major}, $v->{minor}, $v->{revision});
trace("header is ", \$protocol_header);
trace('header is ', \$protocol_header, ' for version ', $v);

$self->write($protocol_header);
$self->version($v);
Expand All @@ -141,6 +141,7 @@ sub _parse_protocol_header {
@version{qw(version major minor revision)} =
split(//, substr($hdr, 4, 4));

# FIXME: we should provide a hook to negotiate down version
$self->error('amqp_max_version', \%version);
return;
}
Expand Down Expand Up @@ -176,7 +177,7 @@ sub _frame_dispatcher {
my ($type, $chan, $size) = @$args;

trace('not enough data for frame payload'), return
if length($$bref) < $size + 1; ## include frame-header + frame-end
if length($$bref) < $size + 1; ## include frame-end

my $marker = ord(substr($$bref, $size, 1, ''));
## FIXME: revisit this - same problem - we need to 'skip until EOF'
Expand Down

0 comments on commit 4757e92

Please sign in to comment.