Check-in [ba8af8731f]
Not logged in
Overview

SHA1 Hash:ba8af8731f5f2493582d3416dcd42c941eadc8fe
Date: 2008-05-18 17:29:22
User: drh
Comment:Sync server responds to reqconfig cards. Allow cloning of repositories that contain tickets.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/tkt.c from [5b74369b2c] to [b7cd94e959].

@@ -186,11 +186,11 @@
   if( createFlag ){
     db_multi_exec("INSERT OR IGNORE INTO ticket(tkt_uuid, tkt_mtime) "
                   "VALUES(%Q, 0)", p->zTicketUuid);
   }
   blob_zero(&sql);
-  blob_appendf(&sql, "UPDATE ticket SET tkt_mtime=:mtime");
+  blob_appendf(&sql, "UPDATE OR REPLACE ticket SET tkt_mtime=:mtime");
   zSep = "SET";
   for(i=0; i<p->nField; i++){
     const char *zName = p->aField[i].zName;
     if( zName[0]=='+' ){
       zName++;

Modified src/xfer.c from [fdac8fe810] to [0e1aa871ca].

@@ -678,13 +678,25 @@
     ** Request a configuration value
     */
     if( blob_eq(&xfer.aToken[0], "reqconfig")
      && xfer.nToken==2
     ){
-      /* TBD: Get the configuration name */
-      /* Check to insure the configuration transfer is authorized */
-      /* Construct the "config" message */
+      if( g.okRead ){
+        char *zName = blob_str(&xfer.aToken[1]);
+        int i;
+        for(i=0; i<count(aSafeConfig); i++){
+          if( strcmp(aSafeConfig[i].zName, zName)==0 ){
+            char *zValue = db_get(zName, 0);
+            if( zValue ){
+              blob_appendf(xfer.pOut, "config %s %d\n%s\n", zName,
+                           strlen(zValue), zValue);
+              free(zValue);
+            }
+            break;
+          }
+        }
+      }
     }else
 
     /*    cookie TEXT
     **
     ** A cookie contains a arbitrary-length argument that is server-defined.