Fossil SCM

Make sure the table of unversioned files exists before a uvfile or uvgimme card is acted on. A repository that had never held an unversioned file answered such a card with a database error when the other side had sent no uv-hash pragma first.

dmestas 2026-11-16 11:05 UTC small-fixes-2
Commit 4377c765a9c135e4ab8128c8328f01a4a462e101c7086195b2b21d39279a623d
1 file changed +4
+4
--- src/xfer.c
+++ src/xfer.c
@@ -423,10 +423,13 @@
423423
goto end_accept_unversioned_file;
424424
}
425425
426426
/* Make sure we have a valid g.rcvid marker */
427427
content_rcvid_init(0);
428
+
429
+ /* The table might not exist yet if the other side sent no uv-hash pragma */
430
+ unversioned_schema();
428431
429432
/* Check to see if current content really should be overwritten. Ideally,
430433
** a uvfile card should never have been sent unless the overwrite should
431434
** occur. But do not trust the sender. Double-check.
432435
*/
@@ -779,10 +782,11 @@
779782
int isClient /* True if sending from client to server */
780783
){
781784
Stmt q1;
782785
int isFull = !isClient && (int)blob_size(pXfer->pOut)>=pXfer->mxSend;
783786
787
+ unversioned_schema();
784788
if( isFull ) noContent = 1;
785789
if( noContent ){
786790
db_prepare(&q1,
787791
"SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q",
788792
zName
789793
--- src/xfer.c
+++ src/xfer.c
@@ -423,10 +423,13 @@
423 goto end_accept_unversioned_file;
424 }
425
426 /* Make sure we have a valid g.rcvid marker */
427 content_rcvid_init(0);
 
 
 
428
429 /* Check to see if current content really should be overwritten. Ideally,
430 ** a uvfile card should never have been sent unless the overwrite should
431 ** occur. But do not trust the sender. Double-check.
432 */
@@ -779,10 +782,11 @@
779 int isClient /* True if sending from client to server */
780 ){
781 Stmt q1;
782 int isFull = !isClient && (int)blob_size(pXfer->pOut)>=pXfer->mxSend;
783
 
784 if( isFull ) noContent = 1;
785 if( noContent ){
786 db_prepare(&q1,
787 "SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q",
788 zName
789
--- src/xfer.c
+++ src/xfer.c
@@ -423,10 +423,13 @@
423 goto end_accept_unversioned_file;
424 }
425
426 /* Make sure we have a valid g.rcvid marker */
427 content_rcvid_init(0);
428
429 /* The table might not exist yet if the other side sent no uv-hash pragma */
430 unversioned_schema();
431
432 /* Check to see if current content really should be overwritten. Ideally,
433 ** a uvfile card should never have been sent unless the overwrite should
434 ** occur. But do not trust the sender. Double-check.
435 */
@@ -779,10 +782,11 @@
782 int isClient /* True if sending from client to server */
783 ){
784 Stmt q1;
785 int isFull = !isClient && (int)blob_size(pXfer->pOut)>=pXfer->mxSend;
786
787 unversioned_schema();
788 if( isFull ) noContent = 1;
789 if( noContent ){
790 db_prepare(&q1,
791 "SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q",
792 zName
793

Keyboard Shortcuts

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