Diff
Not logged in

Differences From:

File src/xfer.c part of check-in [16ec6e558b] - Always redirect incoming HTTP requests to the /xfer method when the content-type is application/x-fossil. by drh on 2008-05-29 14:00:27. [view]

To:

File src/xfer.c part of check-in [3cb547be2c] - Code to randomize messages from client to the server. by drh on 2008-07-26 14:02:33. [view]

@@ -522,8 +522,9 @@
   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
@@ -840,8 +841,9 @@
   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.
     */
@@ -871,8 +873,15 @@
         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:",