aiocoap icon indicating copy to clipboard operation
aiocoap copied to clipboard

transport_tuning updates not propagated to OSCORE

Open lemikev opened this issue 11 months ago • 1 comments

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

lemikev avatar Feb 18 '25 20:02 lemikev

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.

chrysn avatar Feb 24 '25 11:02 chrysn