|
|
@ -1207,12 +1207,13 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess
|
|
|
|
|
|
|
|
|
|
|
|
int total_len = strlen(total);
|
|
|
|
int total_len = strlen(total);
|
|
|
|
|
|
|
|
|
|
|
|
int total_ops = (total_len - 1) * (total_len - 2) / 2;
|
|
|
|
int total_ops = 2 * (total_len - 1) * (total_len - 2) / 2;
|
|
|
|
int ops = 0 ;
|
|
|
|
int ops = 0 ;
|
|
|
|
|
|
|
|
|
|
|
|
size_t buf1_len, buf2_len, buf3_len;
|
|
|
|
size_t buf1_len, buf2_len, buf3_len;
|
|
|
|
|
|
|
|
|
|
|
|
int i,j;
|
|
|
|
int i,j,type_both;
|
|
|
|
|
|
|
|
for (type_both = 0; type_both < 2; type_both ++ ) {
|
|
|
|
for (j = 2; j < total_len; j ++ ) {
|
|
|
|
for (j = 2; j < total_len; j ++ ) {
|
|
|
|
for (i = 1; i < j; i ++ ) {
|
|
|
|
for (i = 1; i < j; i ++ ) {
|
|
|
|
|
|
|
|
|
|
|
@ -1222,7 +1223,7 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ops += 1;
|
|
|
|
ops += 1;
|
|
|
|
|
|
|
|
|
|
|
|
parser_init(r1->type);
|
|
|
|
parser_init(type_both ? HTTP_BOTH : r1->type);
|
|
|
|
|
|
|
|
|
|
|
|
buf1_len = i;
|
|
|
|
buf1_len = i;
|
|
|
|
strncpy(buf1, total, buf1_len);
|
|
|
|
strncpy(buf1, total, buf1_len);
|
|
|
@ -1279,10 +1280,11 @@ test_scan (const struct message *r1, const struct message *r2, const struct mess
|
|
|
|
parser_free();
|
|
|
|
parser_free();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
puts("\b\b\b\b100%");
|
|
|
|
puts("\b\b\b\b100%");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
error:
|
|
|
|
error:
|
|
|
|
fprintf(stderr, "i=%d j=%d\n", i, j);
|
|
|
|
fprintf(stderr, "i=%d j=%d\n", i, j);
|
|
|
|
fprintf(stderr, "buf1 (%u) %s\n\n", (unsigned int)buf1_len, buf1);
|
|
|
|
fprintf(stderr, "buf1 (%u) %s\n\n", (unsigned int)buf1_len, buf1);
|
|
|
|
fprintf(stderr, "buf2 (%u) %s\n\n", (unsigned int)buf2_len , buf2);
|
|
|
|
fprintf(stderr, "buf2 (%u) %s\n\n", (unsigned int)buf2_len , buf2);
|
|
|
|