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

Andrew Stitcher commented on PROTON-2913:
-----------------------------------------

Of course the irony is that we just eliminated unnecessary headers and 
properties sections in encoded messages, but this could potentially generate 
illegal messages with 0 length, which is how this issue was noticed! Now we 
make the minimum message size 4 bytes again. Still better than the previous 
illegal 8 byte sequence!

> pn_message_encode will create an illegal AMQP message if there is no message 
> body
> ---------------------------------------------------------------------------------
>
>                 Key: PROTON-2913
>                 URL: https://issues.apache.org/jira/browse/PROTON-2913
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: proton-c-0.40.0
>            Reporter: Andrew Stitcher
>            Assignee: Andrew Stitcher
>            Priority: Major
>
> If {{pn_message_encode()}} is called but no body has been set it will encode 
> a message with no section for the body. This is not a legal AMQP message as 
> they must contain one (or potentially more) of the valid message body types.
> There are 2 potential directions for fixes: either make this an error and 
> return an error code and do nothing, or encode a valid body.
> Since this bug has been around since the beginning of proton, it is possible 
> that there is code out there that will not take well to receiving an error 
> code in this circumstance even if it is bad code generating and illegal AMQP 
> frame!
> So I think it's best to generate an AMQP null value as the body in this case. 
> This is a valid AMQP message and will be treated as None or null by the 
> various language decoders out there. 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to