chrysn / aiocoap

The Python CoAP library
Other
262 stars 119 forks source link

Fix floor operation to limit payload to a multiple of 1024 #299

Closed ChrisCuts closed 1 year ago

ChrisCuts commented 1 year ago

It occurred, that on TCP block transport the payload size was invalid.

Error log in client:

<ERROR> asyncio - Task exception was never retrieved
future: <Task finished name='Task-4' coro=<CoapClient.get_content() done, defined at /workspace/src/coap_client.py:240> exception=NetworkError('None')>
Traceback (most recent call last):
  File "/workspace/src/coap_client.py", line 248, in get_content
    resp = await self.get('/events')
  File "/workspace/src/coap_client.py", line 113, in get
    response = await self._send(path)
  File "/workspace/src/coap_client.py", line 68, in _send
    return await self._context.request(request).response
  File "/usr/local/lib/python3.8/site-packages/aiocoap/protocol.py", line 842, in _run_outer
    await cls._run(app_request, response, weak_observation, protocol, log)
  File "/usr/local/lib/python3.8/site-packages/aiocoap/protocol.py", line 894, in _run
    blockresponse = await blockrequest.response
aiocoap.error.NetworkError: None

Wireshark log: Screenshot from 2023-02-02 11-39-49

chrysn commented 1 year ago

This has been merged, GitHub just doesn't recognize a Merges: line.