Fossil SCM
Improved error message when a received artifact has an incorrect hash.
Commit
4c8e6d91d2dd8b3fd872a5a1d65ca89d50f139cd
Parent
dda5d11d98bfdc1…
1 file changed
+3
-1
+3
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -191,11 +191,13 @@ | ||
| 191 | 191 | }else{ |
| 192 | 192 | pXfer->nFileRcvd++; |
| 193 | 193 | } |
| 194 | 194 | sha1sum_blob(&content, &hash); |
| 195 | 195 | if( !blob_eq_str(&pXfer->aToken[1], blob_str(&hash), -1) ){ |
| 196 | - blob_appendf(&pXfer->err, "content does not match sha1 hash"); | |
| 196 | + blob_appendf(&pXfer->err, | |
| 197 | + "wrong hash on received artifact: expected %s but got %s", | |
| 198 | + blob_str(&pXfer->aToken[1]), blob_str(&hash)); | |
| 197 | 199 | } |
| 198 | 200 | rid = content_put_ex(&content, blob_str(&hash), 0, 0, isPriv); |
| 199 | 201 | Th_AppendToList(pzUuidList, pnUuidList, blob_str(&hash), blob_size(&hash)); |
| 200 | 202 | blob_reset(&hash); |
| 201 | 203 | if( rid==0 ){ |
| 202 | 204 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -191,11 +191,13 @@ | |
| 191 | }else{ |
| 192 | pXfer->nFileRcvd++; |
| 193 | } |
| 194 | sha1sum_blob(&content, &hash); |
| 195 | if( !blob_eq_str(&pXfer->aToken[1], blob_str(&hash), -1) ){ |
| 196 | blob_appendf(&pXfer->err, "content does not match sha1 hash"); |
| 197 | } |
| 198 | rid = content_put_ex(&content, blob_str(&hash), 0, 0, isPriv); |
| 199 | Th_AppendToList(pzUuidList, pnUuidList, blob_str(&hash), blob_size(&hash)); |
| 200 | blob_reset(&hash); |
| 201 | if( rid==0 ){ |
| 202 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -191,11 +191,13 @@ | |
| 191 | }else{ |
| 192 | pXfer->nFileRcvd++; |
| 193 | } |
| 194 | sha1sum_blob(&content, &hash); |
| 195 | if( !blob_eq_str(&pXfer->aToken[1], blob_str(&hash), -1) ){ |
| 196 | blob_appendf(&pXfer->err, |
| 197 | "wrong hash on received artifact: expected %s but got %s", |
| 198 | blob_str(&pXfer->aToken[1]), blob_str(&hash)); |
| 199 | } |
| 200 | rid = content_put_ex(&content, blob_str(&hash), 0, 0, isPriv); |
| 201 | Th_AppendToList(pzUuidList, pnUuidList, blob_str(&hash), blob_size(&hash)); |
| 202 | blob_reset(&hash); |
| 203 | if( rid==0 ){ |
| 204 |