Fixes invalid length on last chunk logic error
This commit is contained in:
parent
e5bc535c72
commit
f1f64667f3
|
@ -300,7 +300,7 @@ void do_upload(char *filename){
|
|||
// Most packets will be `data_chunk_len`, but not the last one
|
||||
size_t actual_size = len - pos > data_chunk_len ? data_chunk_len : len - pos;
|
||||
|
||||
cbor_ensure_success(cbor_encode_byte_string(&map, &payload[pos], data_chunk_len));
|
||||
cbor_ensure_success(cbor_encode_byte_string(&map, &payload[pos], actual_size));
|
||||
|
||||
if (pos == 0) {
|
||||
cbor_ensure_success(cbor_encode_text_stringz(&map, "len"));
|
||||
|
|
Loading…
Reference in New Issue