astitcher commented on pull request #348:
URL: https://github.com/apache/qpid-proton/pull/348#issuecomment-998180939


   > Yes, https://pagure.io/koji/issue/3120 has the background. There is some 
confusion around what a `0` TTL means. Does it mean "send a header with a zero 
value", or "send no header" ?
   
   It seems that for proton-c it means send no header - this is an artifact of 
the C API taking an integer with no distinguished 'None' value. A newly created 
message will have this value anyway - in that sense it is the default value!
   > 
   > Python has a `NoneType`, so a programmer might assume that `0` sends a 
zero header, while `None` means send no header at all. My doc update in this PR 
implicitly clarifies why Proton uses `0` instead of `None` to mean "no ttl 
header".
   
   That is sensible but the the Python binding sits on top of the proton-c so 
cannot set the value to 0 because the c code uses this to mean don't send the 
value. I don't think it matters because send a TTL of 0 makes very little sense 
in any case - meaning this message has already timed out.
   
   It definitely makes sense for the Python binding to translate a None value 
to 0 into the C API.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to