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

ASF subversion and git services commented on PROTON-2913:
---------------------------------------------------------

Commit 67b5455445de6c97fb656f83b2af3331a9d899ab in qpid-proton's branch 
refs/heads/main from Andrew Stitcher
[ https://gitbox.apache.org/repos/asf?p=qpid-proton.git;h=67b545544 ]

PROTON-2913: pn_message_encode could generate an illegal message

If given a message with no message body, pn_message_encode would
generate a message with no body which is illegal in AMQP.

Would have preferred to generate an error in this case, but this would
be a change to a very long standing behaviour.


> 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