Fossil SCM

Sync server responds to reqconfig cards. Allow cloning of repositories that contain tickets.

drh 2008-05-18 17:29 trunk
Commit ba8af8731f5f2493582d3416dcd42c941eadc8fe
2 files changed +1 -1 +15 -3
+1 -1
--- src/tkt.c
+++ src/tkt.c
@@ -186,11 +186,11 @@
186186
if( createFlag ){
187187
db_multi_exec("INSERT OR IGNORE INTO ticket(tkt_uuid, tkt_mtime) "
188188
"VALUES(%Q, 0)", p->zTicketUuid);
189189
}
190190
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");
192192
zSep = "SET";
193193
for(i=0; i<p->nField; i++){
194194
const char *zName = p->aField[i].zName;
195195
if( zName[0]=='+' ){
196196
zName++;
197197
--- 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 @@
678678
** Request a configuration value
679679
*/
680680
if( blob_eq(&xfer.aToken[0], "reqconfig")
681681
&& xfer.nToken==2
682682
){
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
+ }
686698
}else
687699
688700
/* cookie TEXT
689701
**
690702
** A cookie contains a arbitrary-length argument that is server-defined.
691703
--- 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

Keyboard Shortcuts

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