mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-31 06:55:47 +03:00
block.c: Make sure ETAG option gets properly added
It is possible that there is, say, a Block2 option already in the PDU so need to make sure ETAG option is always added in.
This commit is contained in:
1 parent
f3b1d54519
commit
8b7539f2bf
1 file changed
+1
-1
+1
-1
@@ -289,7 +289,7 @@ coap_add_data_blocked_response(const coap_pdu_t *request,
|
||||
/* add etag for the resource */
|
||||
memset(etag, 0, sizeof(etag));
|
||||
coap_hash(data, length, etag);
|
||||
coap_add_option_internal(response, COAP_OPTION_ETAG, sizeof(etag), etag);
|
||||
coap_insert_option(response, COAP_OPTION_ETAG, sizeof(etag), etag);
|
||||
|
||||
coap_insert_option(response, COAP_OPTION_CONTENT_FORMAT,
|
||||
coap_encode_var_safe(buf, sizeof(buf),
|
||||
|
||||
Reference in new issue
Block a user