Diff
Not logged in

Differences From:

File src/xfer.c part of check-in [243e02bfbd] - Improvements to cloning performance. by drh on 2008-05-18 15:51:05. [view]

To:

File src/xfer.c part of check-in [ba8af8731f] - Sync server responds to reqconfig cards. Allow cloning of repositories that contain tickets. by drh on 2008-05-18 17:29:22. [view]

@@ -679,11 +679,23 @@
     */
     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
     **