You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by aa...@apache.org on 2002/07/01 19:38:17 UTC

cvs commit: httpd-test/flood flood_profile.c flood_round_robin.c flood_round_robin.h

aaron       2002/07/01 10:38:17

  Modified:    flood    flood_profile.c flood_round_robin.c
                        flood_round_robin.h
  Log:
  Implement a new verification routine that doesn't produce false
  negatives for HTTP/1.0 connections, and treats 2xx and 3xx HTTP
  status returns as successes.
  
  Submitted by: Jacek Prucia <ja...@7bulls.com>
  Reviewed by:  Aaron Bannert
  
  Revision  Changes    Path
  1.21      +1 -0      httpd-test/flood/flood_profile.c
  
  Index: flood_profile.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/flood/flood_profile.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- flood_profile.c	31 May 2002 07:59:27 -0000	1.20
  +++ flood_profile.c	1 Jul 2002 17:38:16 -0000	1.21
  @@ -270,6 +270,7 @@
   
       /* Verification by OK/200 */
       {"verify_resp",      "verify_200",                   &verify_200},
  +    {"verify_resp",      "verify_status_code",           &verify_status_code},
   
       /* Simple Reports */
       {"report_init",      "simple_report_init",           &simple_report_init},
  
  
  
  1.25      +19 -0     httpd-test/flood/flood_round_robin.c
  
  Index: flood_round_robin.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/flood/flood_round_robin.c,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- flood_round_robin.c	31 May 2002 07:59:27 -0000	1.24
  +++ flood_round_robin.c	1 Jul 2002 17:38:16 -0000	1.25
  @@ -892,6 +892,25 @@
       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;
  
  
  
  1.4       +4 -0      httpd-test/flood/flood_round_robin.h
  
  Index: flood_round_robin.h
  ===================================================================
  RCS file: /home/cvs/httpd-test/flood/flood_round_robin.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- flood_round_robin.h	29 Jul 2001 15:43:07 -0000	1.3
  +++ flood_round_robin.h	1 Jul 2002 17:38:16 -0000	1.4
  @@ -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);