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.

dmestas 2026-11-16 08:40 UTC small-fixes-2
Commit d80d75c679780374b2efd0e9fab15b3971f66fd254fd75d5ae08bf09e2835831
1 file changed +10 -1
+10 -1
--- src/xfer.c
+++ src/xfer.c
@@ -293,20 +293,29 @@
293293
}
294294
if( uuid_is_shunned(blob_str(&pXfer->aToken[1])) ){
295295
/* Ignore files that have been shunned */
296296
blob_reset(&content);
297297
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;
298307
}
299308
if( pXfer->nToken==5 ){
300309
srcid = rid_from_uuid(&pXfer->aToken[2], 1, isPriv);
301310
pXfer->nDeltaRcvd++;
302311
}else{
303312
srcid = 0;
304313
pXfer->nFileRcvd++;
305314
}
306315
rid = content_put_ex(&content, blob_str(&pXfer->aToken[1]), srcid,
307
- szC, isPriv);
316
+ szU, isPriv);
308317
Th_AppendToList(pzUuidList, pnUuidList, blob_str(&pXfer->aToken[1]),
309318
blob_size(&pXfer->aToken[1]));
310319
remote_has(rid);
311320
blob_reset(&content);
312321
}
313322
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button