qpid-proton mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bozo Dragojevic <bo...@digiverse.si>
Subject Re: bug in java ReceiverImpl?
Date Sun, 29 Sep 2013 13:01:33 GMT
On 29. 09. 13 13:59, Rafael Schloming wrote:
> 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.
>

Thanks for the explanation! Looked more thoroughly at how incoming bytes 
are accounted for
and I now get it, missed the part where incoming bytes are 'consumed' by 
ReceiverImpl.recv(),
both of those places balance against TransportSession.handleTransfer()

Bozzo

Mime
View raw message