qpid-proton mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Schloming <...@alum.mit.edu>
Subject Re: bug in java ReceiverImpl?
Date Sun, 29 Sep 2013 11:59:32 GMT
On Sun, Sep 29, 2013 at 7:35 AM, Bozo Dragojevic <bozzo@digiverse.si> wrote:

> Hi,
> I've just noticed something that doesnt seem right:
> ReceiverImpl.advance()  {
> ...
>             getSession().**incrementIncomingBytes(-**current.pending());
> but the Delivery should always have 0 pending bytes when advance() is
> called?

Not necessarily, the delivery will only have zero bytes if you read all the
message data, however the API lets you advance over a message without
necessarily doing this.

I initially thought the same as you do and didn't have this code in there,
however some of the tests actually don't bother looking at the message
content,and so the accounting was in error by the number of bytes of data
that wasn't read.

In practice it might be a bit odd to skip an entire message like that,
however I can imagine scenarios where an application would read part of a
message, e.g. examine the early bytes of a message and decide that the rest
of that particular message was uninteresting and then call advance while
there was still pending data for that delivery.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message