Fossil SCM
Sync server responds to reqconfig cards. Allow cloning of repositories that contain tickets.
Commit
ba8af8731f5f2493582d3416dcd42c941eadc8fe
Parent
791a513c289ded0…
2 files changed
+1
-1
+15
-3
+1
-1
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -186,11 +186,11 @@ | ||
| 186 | 186 | if( createFlag ){ |
| 187 | 187 | db_multi_exec("INSERT OR IGNORE INTO ticket(tkt_uuid, tkt_mtime) " |
| 188 | 188 | "VALUES(%Q, 0)", p->zTicketUuid); |
| 189 | 189 | } |
| 190 | 190 | blob_zero(&sql); |
| 191 | - blob_appendf(&sql, "UPDATE ticket SET tkt_mtime=:mtime"); | |
| 191 | + blob_appendf(&sql, "UPDATE OR REPLACE ticket SET tkt_mtime=:mtime"); | |
| 192 | 192 | zSep = "SET"; |
| 193 | 193 | for(i=0; i<p->nField; i++){ |
| 194 | 194 | const char *zName = p->aField[i].zName; |
| 195 | 195 | if( zName[0]=='+' ){ |
| 196 | 196 | zName++; |
| 197 | 197 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -186,11 +186,11 @@ | |
| 186 | if( createFlag ){ |
| 187 | db_multi_exec("INSERT OR IGNORE INTO ticket(tkt_uuid, tkt_mtime) " |
| 188 | "VALUES(%Q, 0)", p->zTicketUuid); |
| 189 | } |
| 190 | blob_zero(&sql); |
| 191 | blob_appendf(&sql, "UPDATE ticket SET tkt_mtime=:mtime"); |
| 192 | zSep = "SET"; |
| 193 | for(i=0; i<p->nField; i++){ |
| 194 | const char *zName = p->aField[i].zName; |
| 195 | if( zName[0]=='+' ){ |
| 196 | zName++; |
| 197 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -186,11 +186,11 @@ | |
| 186 | if( createFlag ){ |
| 187 | db_multi_exec("INSERT OR IGNORE INTO ticket(tkt_uuid, tkt_mtime) " |
| 188 | "VALUES(%Q, 0)", p->zTicketUuid); |
| 189 | } |
| 190 | blob_zero(&sql); |
| 191 | blob_appendf(&sql, "UPDATE OR REPLACE ticket SET tkt_mtime=:mtime"); |
| 192 | zSep = "SET"; |
| 193 | for(i=0; i<p->nField; i++){ |
| 194 | const char *zName = p->aField[i].zName; |
| 195 | if( zName[0]=='+' ){ |
| 196 | zName++; |
| 197 |
+15
-3
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -678,13 +678,25 @@ | ||
| 678 | 678 | ** Request a configuration value |
| 679 | 679 | */ |
| 680 | 680 | if( blob_eq(&xfer.aToken[0], "reqconfig") |
| 681 | 681 | && xfer.nToken==2 |
| 682 | 682 | ){ |
| 683 | - /* TBD: Get the configuration name */ | |
| 684 | - /* Check to insure the configuration transfer is authorized */ | |
| 685 | - /* Construct the "config" message */ | |
| 683 | + if( g.okRead ){ | |
| 684 | + char *zName = blob_str(&xfer.aToken[1]); | |
| 685 | + int i; | |
| 686 | + for(i=0; i<count(aSafeConfig); i++){ | |
| 687 | + if( strcmp(aSafeConfig[i].zName, zName)==0 ){ | |
| 688 | + char *zValue = db_get(zName, 0); | |
| 689 | + if( zValue ){ | |
| 690 | + blob_appendf(xfer.pOut, "config %s %d\n%s\n", zName, | |
| 691 | + strlen(zValue), zValue); | |
| 692 | + free(zValue); | |
| 693 | + } | |
| 694 | + break; | |
| 695 | + } | |
| 696 | + } | |
| 697 | + } | |
| 686 | 698 | }else |
| 687 | 699 | |
| 688 | 700 | /* cookie TEXT |
| 689 | 701 | ** |
| 690 | 702 | ** A cookie contains a arbitrary-length argument that is server-defined. |
| 691 | 703 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -678,13 +678,25 @@ | |
| 678 | ** Request a configuration value |
| 679 | */ |
| 680 | if( blob_eq(&xfer.aToken[0], "reqconfig") |
| 681 | && xfer.nToken==2 |
| 682 | ){ |
| 683 | /* TBD: Get the configuration name */ |
| 684 | /* Check to insure the configuration transfer is authorized */ |
| 685 | /* Construct the "config" message */ |
| 686 | }else |
| 687 | |
| 688 | /* cookie TEXT |
| 689 | ** |
| 690 | ** A cookie contains a arbitrary-length argument that is server-defined. |
| 691 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -678,13 +678,25 @@ | |
| 678 | ** Request a configuration value |
| 679 | */ |
| 680 | if( blob_eq(&xfer.aToken[0], "reqconfig") |
| 681 | && xfer.nToken==2 |
| 682 | ){ |
| 683 | if( g.okRead ){ |
| 684 | char *zName = blob_str(&xfer.aToken[1]); |
| 685 | int i; |
| 686 | for(i=0; i<count(aSafeConfig); i++){ |
| 687 | if( strcmp(aSafeConfig[i].zName, zName)==0 ){ |
| 688 | char *zValue = db_get(zName, 0); |
| 689 | if( zValue ){ |
| 690 | blob_appendf(xfer.pOut, "config %s %d\n%s\n", zName, |
| 691 | strlen(zValue), zValue); |
| 692 | free(zValue); |
| 693 | } |
| 694 | break; |
| 695 | } |
| 696 | } |
| 697 | } |
| 698 | }else |
| 699 | |
| 700 | /* cookie TEXT |
| 701 | ** |
| 702 | ** A cookie contains a arbitrary-length argument that is server-defined. |
| 703 |