Check-in [469efd6a7c]
Not logged in
Overview

SHA1 Hash:469efd6a7ce8ba441b7c7a558f15e3f7ab5847e4
Date: 2009-10-01 14:47:54
User: drh
Comment:Disable the check of the "server-code" on a sync. This means that two repositories with the same "server-code" can sync with each other, which allows a repository to be copied using an ordinary file copy, and without having to run clone.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/xfer.c from [2973354cfc] to [b02eb5519c].

@@ -658,13 +658,21 @@
     if( xfer.nToken==3
      && (blob_eq(&xfer.aToken[0], "pull") || blob_eq(&xfer.aToken[0], "push"))
      && blob_is_uuid(&xfer.aToken[1])
      && blob_is_uuid(&xfer.aToken[2])
     ){
-      const char *zSCode;
       const char *zPCode;
 
+#if 0
+      /* This block checks to see if a server is trying to sync with itself.
+      ** This used to be disallowed, but I cannot think of any significant
+      ** harm, so I have disabled the check.
+      **
+      ** With this check disabled, it is sufficient to copy the repository
+      ** database.  No need to run clone.
+      */
+      const char *zSCode;
       zSCode = db_get("server-code", 0);
       if( zSCode==0 ){
         fossil_panic("missing server code");
       }
       if( blob_eq_str(&xfer.aToken[1], zSCode, -1) ){
@@ -671,10 +679,12 @@
         cgi_reset_content();
         @ error server\sloop
         nErr++;
         break;
       }
+#endif
+
       zPCode = db_get("project-code", 0);
       if( zPCode==0 ){
         fossil_panic("missing project code");
       }
       if( !blob_eq_str(&xfer.aToken[2], zPCode, -1) ){