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.
Commit
4377c765a9c135e4ab8128c8328f01a4a462e101c7086195b2b21d39279a623d
Parent
ab28f6ca06d951a…
1 file changed
+4
+4
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -423,10 +423,13 @@ | ||
| 423 | 423 | goto end_accept_unversioned_file; |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | /* Make sure we have a valid g.rcvid marker */ |
| 427 | 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(); | |
| 428 | 431 | |
| 429 | 432 | /* Check to see if current content really should be overwritten. Ideally, |
| 430 | 433 | ** a uvfile card should never have been sent unless the overwrite should |
| 431 | 434 | ** occur. But do not trust the sender. Double-check. |
| 432 | 435 | */ |
| @@ -779,10 +782,11 @@ | ||
| 779 | 782 | int isClient /* True if sending from client to server */ |
| 780 | 783 | ){ |
| 781 | 784 | Stmt q1; |
| 782 | 785 | int isFull = !isClient && (int)blob_size(pXfer->pOut)>=pXfer->mxSend; |
| 783 | 786 | |
| 787 | + unversioned_schema(); | |
| 784 | 788 | if( isFull ) noContent = 1; |
| 785 | 789 | if( noContent ){ |
| 786 | 790 | db_prepare(&q1, |
| 787 | 791 | "SELECT mtime, hash, encoding, sz FROM unversioned WHERE name=%Q", |
| 788 | 792 | zName |
| 789 | 793 |
| --- 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 |