go-coap icon indicating copy to clipboard operation
go-coap copied to clipboard

not get block2 option in server

Open lx121451 opened this issue 3 years ago • 4 comments

When I send a Get Message with block2 option,but in server side Options.HasOption(message.Block2) return false。Is there anything that needs special attention?

lx121451 avatar Jan 12 '22 07:01 lx121451

@jkralik I think this is the relevant code:

https://github.com/plgd-dev/go-coap/blob/49cae1ca2883b97159e646b1d05635ceb1f21bd6/net/blockwise/blockwise.go#L534-L540

Do you recall why the Block2 option is removed from the message before its passed to the next handler function? Maybe the error check is inverted?

Danielius1922 avatar Jan 24 '22 12:01 Danielius1922

@lx121451 Pls, why do you need block2? Thx

jkralik avatar Jan 27 '22 18:01 jkralik

Do you recall why the Block2 option is removed from the message before its passed to the next handler function? Maybe the error check is inverted?

No, it's correct.

jkralik avatar Jan 27 '22 18:01 jkralik

@lx121451 Pls, why do you need block2? Thx

Just for test,I'm simulating a file transfer server with separate response!

lx121451 avatar Jan 28 '22 01:01 lx121451

For test you can use https://github.com/plgd-dev/go-coap/blob/master/options/commonOptions.go#L278 to watch all messages that comes to server in v3. I will close the issue, feel free to reopen it.

jkralik avatar Oct 15 '22 15:10 jkralik