httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacek Prucia <>
Subject [PATCH] flood & verify_200
Date Tue, 18 Jun 2002 15:38:30 GMT

I think current flood (tried HEAD) have problems with veryfing
responses. In particular it marks 200 OK responses as 'FAIL' if they are
sent with HTTP/1.0 rather than expected 'HTTP/1.1'. Looks like problem
is with memcpy verification in function verify_200. To work around that
problem i just wrote a little patch just to make things work, which i'm
sending here for verification/blessing/commit. It might turn out that
the patch is a piece of crap -- mostly because I'm really new both to
apr and flood (i'm not sure if that change in profile_event_handlers is
wise thing to do...). However it solves serious (at least for me)
problem, and if patch is wrong -- it has to be done other way.

Besides that, flood is a very useful tool, and i'm using it to do
regression tests for over-sized web application. Looks like flood could
use some more patches to be more suited for this task. In particular, it
would be cool if flood could stop if particular url (or any url as an
option) returns FALSE. This is what i'm going to work on in near future.

One more thing... looks like flood build system is slightly broken. You
can build it, but there's no way to install it in a target directory
(make install fails). Is this a known problem?

Jacek Prucia S.A.

Common subdirectories: flood.orig/CVS and flood/CVS
Common subdirectories: flood.orig/build and flood/build
Common subdirectories: flood.orig/examples and flood/examples
diff -uNP flood.orig/flood_profile.c flood/flood_profile.c
--- flood.orig/flood_profile.c	Tue Jun 18 15:26:40 2002
+++ flood/flood_profile.c	Tue Jun 18 15:43:45 2002
@@ -270,6 +270,7 @@
     /* Verification by OK/200 */
     {"verify_resp",      "verify_200",                   &verify_200},
+    {"verify_resp",      "verify_status_code",          
     /* Simple Reports */
     {"report_init",      "simple_report_init",          
diff -uNP flood.orig/flood_round_robin.c flood/flood_round_robin.c
--- flood.orig/flood_round_robin.c	Tue Jun 18 15:26:40 2002
+++ flood/flood_round_robin.c	Tue Jun 18 15:44:47 2002
@@ -892,6 +892,22 @@
     return APR_SUCCESS;
+apr_status_t verify_status_code(int *verified, profile_t *profile,
request_t *req, response_t *resp)
+    const char delimiter = ' ';
+    char *state, *protocol, *scode;
+    protocol = apr_strtok (resp->rbuf, &delimiter, &state);
+    scode = apr_strtok (NULL, &delimiter, &state);
+    if (scode[0] == '2' || scode[0] == '3')
+        *verified = FLOOD_VALID;
+    else
+        *verified = FLOOD_INVALID;
+    return APR_SUCCESS;
 int round_robin_loop_condition(profile_t *profile)
     round_robin_profile_t *rp;
diff -uNP flood.orig/flood_round_robin.h flood/flood_round_robin.h
--- flood.orig/flood_round_robin.h	Tue Jun 18 15:26:40 2002
+++ flood/flood_round_robin.h	Tue Jun 18 15:45:09 2002
@@ -72,6 +72,10 @@
                         profile_t *profile,
                         request_t *req,
                         response_t *resp);
+apr_status_t verify_status_code(int *verified,
+                        profile_t *profile,
+                        request_t *req,
+                        response_t *resp);
 int round_robin_loop_condition(profile_t *profile);
 apr_status_t round_robin_profile_destroy(profile_t *profile);

View raw message