You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by an...@apache.org on 2018/07/05 20:34:18 UTC
[mynewt-core] 01/01: Merge pull request #1218 from
andrzej-kaczmarek/imgmgr-upload-resume
This is an automated email from the ASF dual-hosted git repository.
andk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
commit 9c62a975759ebe9b0322dc7130d4221ffbe37cb5
Merge: 224128b 580de7c
Author: Andrzej Kaczmarek <an...@codecoup.pl>
AuthorDate: Thu Jul 5 22:34:14 2018 +0200
Merge pull request #1218 from andrzej-kaczmarek/imgmgr-upload-resume
mgmt/imgmgr: Update data hash handling (for image resume)
mgmt/imgmgr/src/imgmgr.c | 46 +++++++++++++++++++++++--------------------
mgmt/imgmgr/src/imgmgr_priv.h | 2 +-
2 files changed, 26 insertions(+), 22 deletions(-)
diff --cc mgmt/imgmgr/src/imgmgr.c
index 3c6cc72,218a478..869b309
--- a/mgmt/imgmgr/src/imgmgr.c
+++ b/mgmt/imgmgr/src/imgmgr.c
@@@ -41,12 -41,12 +41,12 @@@ static int imgr_erase_state(struct mgmt
/** Represents an individual upload request. */
struct imgr_upload_req {
- unsigned long long int off;
- unsigned long long int size;
+ unsigned long long int off; /* -1 if unspecified */
+ unsigned long long int size; /* -1 if unspecified */
size_t data_len;
- size_t data_hash_len;
+ size_t data_sha_len;
uint8_t img_data[MYNEWT_VAL(IMGMGR_MAX_CHUNK_SIZE)];
- uint8_t data_hash[IMGMGR_DATA_HASH_LEN];
+ uint8_t data_sha[IMGMGR_DATA_SHA_LEN];
};
/** Describes what to do during processing of an upload request. */
@@@ -584,10 -584,10 +584,10 @@@ static in
imgr_upload(struct mgmt_cbuf *cb)
{
struct imgr_upload_req req = {
- .off = ULLONG_MAX,
- .size = ULLONG_MAX,
+ .off = -1,
+ .size = -1,
.data_len = 0,
- .data_hash_len = 0,
+ .data_sha_len = 0,
};
const struct cbor_attr_t off_attr[5] = {
[0] = {