You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by dg...@hyperreal.org on 1998/03/03 09:21:55 UTC
cvs commit: apache-1.3/src/modules/test mod_test_util_uri.c
dgaudet 98/03/03 00:21:55
Modified: src/modules/test mod_test_util_uri.c
Log:
(some cvs brokenness going on here)
Aha! Now I understand why Martin modified the uri regex the way he did...
and I documented it. Fix the "GET //foo/bar" bug.
Revision Changes Path
1.2 +18 -7 apache-1.3/src/modules/test/mod_test_util_uri.c
Index: mod_test_util_uri.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/modules/test/mod_test_util_uri.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- mod_test_util_uri.c 1998/03/02 06:51:22 1.1
+++ mod_test_util_uri.c 1998/03/03 08:21:54 1.2
@@ -159,13 +159,12 @@
strp = input_uri;
expect = 0;
- if (u & T_scheme) {
+ /* a scheme requires a hostinfo and vice versa */
+ /* a hostinfo requires a hostname */
+ if (u & (T_scheme|T_user|T_password|T_hostname|T_port_str)) {
expect |= T_scheme;
strp = my_stpcpy(strp, pieces->scheme);
*strp++ = ':';
- }
- /* can't have hostinfo without hostname */
- if (u & (T_user|T_password|T_hostname|T_port_str)) {
*strp++ = '/';
*strp++ = '/';
/* can't have password without user */
@@ -303,9 +302,21 @@
HEADER(fragment);
#undef HEADER
- total_failures = 0;
- for (i = 0; i < sizeof(uri_tests) / sizeof(uri_tests[0]); ++i) {
- total_failures += iterate_pieces(r, &uri_tests[i], i);
+ if (r->args) {
+ i = atoi(r->args);
+ total_failures = iterate_pieces(r, &uri_tests[i], i);
+ }
+ else {
+ total_failures = 0;
+ for (i = 0; i < sizeof(uri_tests) / sizeof(uri_tests[0]); ++i) {
+ total_failures += iterate_pieces(r, &uri_tests[i], i);
+ if (total_failures > 256) {
+ rprintf(r, "</table>\n<b>Stopped early to save your browser "
+ "from certain death!</b>\nTOTAL FAILURES = %u\n",
+ total_failures);
+ return OK;
+ }
+ }
}
rprintf(r, "</table>\nTOTAL FAILURES = %u\n", total_failures);