You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Rob Godfrey (JIRA)" <ji...@apache.org> on 2015/10/10 21:21:05 UTC

[jira] [Comment Edited] (QPID-6784) [Java Broker, Java Client] Client sends too large frames and broker does wrong frame size validation on 0-9

    [ https://issues.apache.org/jira/browse/QPID-6784?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14952002#comment-14952002 ] 

Rob Godfrey edited comment on QPID-6784 at 10/10/15 7:20 PM:
-------------------------------------------------------------

The way frame "size" is defined in AMQP 0-8/9 is that it is not clear whether it includes the type (1 octet), channel (2 octets), size (4 octets) or frame-end (1 octet).  In 0-9-1 it was made explicit that these values should be included.

As such from the perspective of the max frame size communicated on the wire, if the parties have agreed a max frame size of X then the maximal number of bytes sent would, indeed, be X+8 (I think we implemented sending on maximally X+7 because of an incompatibility with the C++ broker). 

If we want to ensure that we want to receive no more than S bytes in a single work unit, for AMQP 0-8/0-9 then the broker needs to send the "max frame size" it accepts as S-8 when it sends this value to the client.  For AMQP 0-9-1 it can use the value of S.


was (Author: rgodfrey):
The way frame "size" is defined in AMQP 0-8/9/9-1 is that it does not include the type (1 octet), channel (2 octets), size (4 octets) or frame-end (1 octet).

As such from the perspective of the max frame size communicated on the wire, if the parties have agreed a max frame size of X then the maximal number of bytes sent would, indeed, be X+8 (I think we implemented sending on maximally X+7 because of an incompatibility with the C++ broker).

If we want to ensure that we want to receive no more than S bytes in a single work unit, then the broker needs to send the "max frame size" it accepts as S-8 when it sends this value to the client.

> [Java Broker, Java Client] Client sends too large frames and broker does wrong frame size validation on 0-9
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-6784
>                 URL: https://issues.apache.org/jira/browse/QPID-6784
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker, Java Client
>    Affects Versions: 0.17, 0.32
>            Reporter: Lorenz Quack
>            Priority: Blocker
>
> The Client does not include the frame attributes (except for 1 byte) in its calculation of the AMQP Frame size thus creating frames which are 7 bytes too large. This happens in {{org.apache.qpid.client.BasicMessageProducer_0_8#calculateContentBodyFrameCount}} and maybe other places.
> The broker on the other end does an incorrect validation (in {{AMQDecoder#decodable}} at least) where it does not take any of the attributes into account thus accepting too large frames.
> Besides not being compliant with the spec this causes problems in {{NonBlockingConnectionPlainDelegate#processData}} where the frame does not fit into a single networkBuffer.
> I did not investigate other protocol versions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org