+ s2length = (b + 1 - 32 + 7) / 8; /* add a bit,
+ * subtract rollsum,
+ * round up
+ * --optimize in compiler--
+ */
+ s2length = MAX(s2length, csum_length);
+ s2length = MIN(s2length, SUM_LENGTH);
+ }
+
+ sum->flength = len;
+ sum->blength = blength;
+ sum->s2length = s2length;
+ sum->count = (len + (blength - 1)) / blength;
+ sum->remainder = (len % blength);
+
+ if (sum->count && verbose > 2) {
+ rprintf(FINFO, "count=%ld rem=%ld blength=%ld s2length=%ld flength=%.0f\n",
+ (long) sum->count, (long) sum->remainder,
+ (long) sum->blength, (long) sum->s2length,
+ (double) sum->flength);
+ }
+}
+
+/**
+ * Perhaps we want to just send an empty checksum set for this file,
+ * which will force the whole thing to be literally transferred.
+ *
+ * When do we do this? If the user's explicitly said they
+ * want the whole thing, or if { they haven't explicitly
+ * requested a delta, and it's local but not batch mode.}
+ *
+ * Whew. */
+static BOOL disable_deltas_p(void)
+{
+ extern int whole_file;
+ extern int local_server;
+ extern int write_batch;
+
+ if (whole_file > 0)
+ return True;
+ if (whole_file == 0 || write_batch)
+ return False;
+ return local_server;