chrysn / aiocoap

The Python CoAP library
Other
267 stars 120 forks source link

Allow setting remote block size for block1 #360

Closed chrysn closed 4 months ago

chrysn commented 4 months ago

While there has been a mechanism that'd allow clients to set the block1 size in outgoing requests without the server's support (eg. because a large initial request would not go through, or because the server would not limit the block size to an efficient value), that was never properly documented.

A newer way of setting per-remote properties around maximum block sizes has been around and used in tests, but was only available at the server because usually only the server has a remote set that doesn't go through any post-processing.

This changes the block size of the undecided remote (which gets set on new requests with the scheme, host and port of the URI) to propagate to the final remote.

The change was prompted by https://github.com/chrysn/aiocoap/issues/359. @moonlight83340, could you try out whether

chrysn commented 4 months ago

Later commits on this PR also update aiocoap-client to use the new mechanism when for --payload-initial-szx; in particular, that setting now influences block1 and block2 alike.

moonlight83340 commented 4 months ago

Thank you, I will take time to test that PR. I read the documentation and yes it would had helped me a lot. So I do think that a good think to write in the documentation. thank you for you quick answer and correction.