Check-in [3cb547be2c]
Not logged in
Overview

SHA1 Hash:3cb547be2c7db73b523813b42fe5cd0d82f429e4
Date: 2008-07-26 14:02:33
User: drh
Comment:Code to randomize messages from client to the server.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/xfer.c from [e9c8669cb1] to [0e2cb48261].

@@ -521,10 +521,11 @@
   db_begin_transaction();
   db_multi_exec(
      "CREATE TEMP TABLE onremote(rid INTEGER PRIMARY KEY);"
   );
   while( blob_line(xfer.pIn, &xfer.line) ){
+    if( blob_buffer(&xfer.line)[0]=='#' ) continue;
     xfer.nToken = blob_tokenize(&xfer.line, xfer.aToken, count(xfer.aToken));
 
     /*   file UUID SIZE \n CONTENT
     **   file UUID DELTASRC SIZE \n CONTENT
     **
@@ -839,10 +840,11 @@
   }
   printf(zLabelFormat, "", "Bytes", "Cards", "Artifacts", "Deltas");
 
   while( go ){
     int newPhantom = 0;
+    char *zRandomness;
 
     /* Send make the most recently received cookie.  Let the server
     ** figure out if this is a cookie that it cares about.
     */
     zCookie = db_get("cookie", 0);
@@ -870,10 +872,17 @@
         zName = configure_next_name(configMask);
         nCard++;
       }
       configMask = 0;
     }
+
+    /* Append randomness to the end of the message */
+#if 0   /* Enable this after all servers have upgraded */
+    zRandomness = db_text(0, "SELECT hex(randomblob(20))");
+    blob_appendf(&send, "# %s\n", zRandomness);
+    free(zRandomness);
+#endif
 
     /* Exchange messages with the server */
     nFileSend = xfer.nFileSent + xfer.nDeltaSent;
     printf(zValueFormat, "Send:",
             blob_size(&send), nCard+xfer.nGimmeSent+xfer.nIGotSent,