Andrew Stitcher created PROTON-2913:
---------------------------------------

             Summary: 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


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 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