aiocoap
aiocoap copied to clipboard
transport_tuning updates not propagated to OSCORE
The update of the transport_tuning constant(s) don't seem to work for OSCORE messages. For example, the following code works for CoAP but not for OSCORE.
request.mtype = aiocoap.CON
request.transport_tuning.MAX_RETRANSMIT = 1
response = await aiocoap_context.request(request).response
To fix the issue, I had to add the following line in oscore.py
outer_message = Message(
code=outer_code,
uri_host=outer_host,
observe=None if message.code.is_response() else message.opt.observe,
)
# BUG fix
outer_message.transport_tuning = inner_message.transport_tuning
Thanks for the report and the workaround. This should indeed be transparent, I'll have to look into how to set it so that there can still be transport tuning for OSCORE in addition to any next layer.