httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-test/perl-framework/c-modules/random_chunk mod_random_chunk.c
Date Wed, 21 Nov 2001 01:37:42 GMT
dougm       01/11/20 17:37:42

  Modified:    perl-framework/c-modules/random_chunk mod_random_chunk.c
  Log:
  switch to using httpd_test_split_qs_numbers()
  
  Revision  Changes    Path
  1.7       +8 -14     httpd-test/perl-framework/c-modules/random_chunk/mod_random_chunk.c
  
  Index: mod_random_chunk.c
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/c-modules/random_chunk/mod_random_chunk.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mod_random_chunk.c	2001/11/06 16:03:00	1.6
  +++ mod_random_chunk.c	2001/11/21 01:37:42	1.7
  @@ -97,12 +97,13 @@
   #define MAX_SEGMENT     32
   #define ONE_WEIGHT      (256-32)
   
  +#define WANT_HTTPD_TEST_SPLIT_QS_NUMBERS
  +#include "httpd_test_util.c"
  +
   static int random_chunk_handler(request_rec *r)
   {
  -    const char *args;
  -    char *endptr;
  -    unsigned int seed;
  -    unsigned int count;
  +    unsigned int seed = 0;
  +    unsigned int count = 0;
       int i;
       char buf[MAX_SEGMENT + 1];
       unsigned int len;
  @@ -130,21 +131,14 @@
       if (r->header_only) {
           return OK;
       }
  +
  +    httpd_test_split_qs_numbers(r, &seed, &count, NULL);
   
  -    args = r->args;
  -    if (!args) {
  -error:
  +    if (!count) {
           ap_rputs("Must include args! ... "
                    "of the form <code>?seed,count</code>", r);
           return 0;
       }
  -
  -    seed = strtol(args, &endptr, 0);
  -    if (!endptr || *endptr != ',') {
  -        goto error;
  -    }
  -    ++endptr;
  -    count = strtol(endptr, &endptr, 0);
   
       srandom(seed); /* XXX: apr-ize */
   
  
  
  

Mime
View raw message