plgd-dev / go-coap

Implementation of CoAP Server & Client in Go
https://coap.technology
Apache License 2.0
448 stars 116 forks source link

fix returned block size in blockwise transfer #394

Closed ljupcho closed 2 years ago

ljupcho commented 2 years ago

Steps to reproduce:

  1. Run a server for example on port 5688
  2. Using coap client (https://libcoap.net/doc/reference/4.2.0/man_coap-client.html) run a request with giving block size, ex: coap-client -T token -b 16 -v 9 -m get 'coap://localhost:5688/a'

Actual result: Server ignores the Block2 option of 16 and returned whole response in single block as default server config is 1024 bytes SZX and this maxSZX from server is used instead of suggested size from client.

Expected result: There should be multiple blocks with single block containing max 16 characters of transferred content as specified with flag "-b 16".

jkralik commented 2 years ago

Thx for the fix.