/* XXX: we may want to vary this */
static const char *nl = "\r\n";
+/**********************************************************************
+ * Generate a synthetic body
+ */
+
+static const char *
+synth_body(const char *len)
+{
+ int i, j, k, l;
+ char *b;
+
+
+ AN(len);
+ i = strtoul(len, NULL, 0);
+ assert(i > 0);
+ b = malloc(i + 1);
+ AN(b);
+ l = k = '!';
+ for (j = 0; j < i; j++) {
+ if ((j % 64) == 63) {
+ b[j] = '\n';
+ k++;
+ if (k == '~')
+ k = '!';
+ l = k;
+ } else {
+ b[j] = l++;
+ if (l == '~')
+ l = '!';
+ }
+ }
+ b[i - 1] = '\n';
+ b[i] = '\0';
+ return (b);
+}
+
/**********************************************************************
* Finish and write the vsb to the fd
*/
AZ(body);
body = av[1];
av++;
+ } else if (!strcmp(*av, "-bodylen")) {
+ AZ(body);
+ body = synth_body(av[1]);
+ av++;
} else
break;
}
AZ(body);
body = av[1];
av++;
+ } else if (!strcmp(*av, "-bodylen")) {
+ AZ(body);
+ body = synth_body(av[1]);
+ av++;
} else
break;
}