Fossil SCM
In xfer_accept_compressed_file(), record the size of the content as the size of an artifact received in a cfile card. The size of its compressed form was recorded, so test-integrity reported a size mismatch for such an artifact until the next rebuild.
Commit
d80d75c679780374b2efd0e9fab15b3971f66fd254fd75d5ae08bf09e2835831
Parent
ad5033a1aa4c818…
1 file changed
+10
-1
+10
-1
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -293,20 +293,29 @@ | ||
| 293 | 293 | } |
| 294 | 294 | if( uuid_is_shunned(blob_str(&pXfer->aToken[1])) ){ |
| 295 | 295 | /* Ignore files that have been shunned */ |
| 296 | 296 | blob_reset(&content); |
| 297 | 297 | return; |
| 298 | + } | |
| 299 | + if( szU==0 | |
| 300 | + && (blob_size(&content)<=4 || blob_uncompress(&content, &content)) | |
| 301 | + ){ | |
| 302 | + /* content_put_ex() takes a size of zero to mean that the content is | |
| 303 | + ** not compressed, so content of no bytes is handed over uncompressed. */ | |
| 304 | + blob_appendf(&pXfer->err, "malformed cfile content"); | |
| 305 | + blob_reset(&content); | |
| 306 | + return; | |
| 298 | 307 | } |
| 299 | 308 | if( pXfer->nToken==5 ){ |
| 300 | 309 | srcid = rid_from_uuid(&pXfer->aToken[2], 1, isPriv); |
| 301 | 310 | pXfer->nDeltaRcvd++; |
| 302 | 311 | }else{ |
| 303 | 312 | srcid = 0; |
| 304 | 313 | pXfer->nFileRcvd++; |
| 305 | 314 | } |
| 306 | 315 | rid = content_put_ex(&content, blob_str(&pXfer->aToken[1]), srcid, |
| 307 | - szC, isPriv); | |
| 316 | + szU, isPriv); | |
| 308 | 317 | Th_AppendToList(pzUuidList, pnUuidList, blob_str(&pXfer->aToken[1]), |
| 309 | 318 | blob_size(&pXfer->aToken[1])); |
| 310 | 319 | remote_has(rid); |
| 311 | 320 | blob_reset(&content); |
| 312 | 321 | } |
| 313 | 322 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -293,20 +293,29 @@ | |
| 293 | } |
| 294 | if( uuid_is_shunned(blob_str(&pXfer->aToken[1])) ){ |
| 295 | /* Ignore files that have been shunned */ |
| 296 | blob_reset(&content); |
| 297 | return; |
| 298 | } |
| 299 | if( pXfer->nToken==5 ){ |
| 300 | srcid = rid_from_uuid(&pXfer->aToken[2], 1, isPriv); |
| 301 | pXfer->nDeltaRcvd++; |
| 302 | }else{ |
| 303 | srcid = 0; |
| 304 | pXfer->nFileRcvd++; |
| 305 | } |
| 306 | rid = content_put_ex(&content, blob_str(&pXfer->aToken[1]), srcid, |
| 307 | szC, isPriv); |
| 308 | Th_AppendToList(pzUuidList, pnUuidList, blob_str(&pXfer->aToken[1]), |
| 309 | blob_size(&pXfer->aToken[1])); |
| 310 | remote_has(rid); |
| 311 | blob_reset(&content); |
| 312 | } |
| 313 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -293,20 +293,29 @@ | |
| 293 | } |
| 294 | if( uuid_is_shunned(blob_str(&pXfer->aToken[1])) ){ |
| 295 | /* Ignore files that have been shunned */ |
| 296 | blob_reset(&content); |
| 297 | return; |
| 298 | } |
| 299 | if( szU==0 |
| 300 | && (blob_size(&content)<=4 || blob_uncompress(&content, &content)) |
| 301 | ){ |
| 302 | /* content_put_ex() takes a size of zero to mean that the content is |
| 303 | ** not compressed, so content of no bytes is handed over uncompressed. */ |
| 304 | blob_appendf(&pXfer->err, "malformed cfile content"); |
| 305 | blob_reset(&content); |
| 306 | return; |
| 307 | } |
| 308 | if( pXfer->nToken==5 ){ |
| 309 | srcid = rid_from_uuid(&pXfer->aToken[2], 1, isPriv); |
| 310 | pXfer->nDeltaRcvd++; |
| 311 | }else{ |
| 312 | srcid = 0; |
| 313 | pXfer->nFileRcvd++; |
| 314 | } |
| 315 | rid = content_put_ex(&content, blob_str(&pXfer->aToken[1]), srcid, |
| 316 | szU, isPriv); |
| 317 | Th_AppendToList(pzUuidList, pnUuidList, blob_str(&pXfer->aToken[1]), |
| 318 | blob_size(&pXfer->aToken[1])); |
| 319 | remote_has(rid); |
| 320 | blob_reset(&content); |
| 321 | } |
| 322 |