The patch fixes 2 things.
* apr_terminate now has the right declaration so it can be used directly 
in atexit
* Win2K gets a divde by zero error when heartbeatres is zero (reproduce via
    support\Debug\ab.exe -k -c 6 -n 100 localhost/

..Ian

Index: ab.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/support/ab.c,v
retrieving revision 1.70
diff -u -r1.70 ab.c
--- ab.c    2001/04/12 07:34:17    1.70
+++ ab.c    2001/06/15 23:10:26
@@ -1079,10 +1079,12 @@
     }
     if (done < requests) {
         struct data s;
-        if ((done) && (!(done % heartbeatres))) {
-        fprintf(stderr, "Completed %ld requests\n", done);
-        fflush(stderr);
-        }
+        if (done) {
+            if  ((heartbeatres >0) && !(done % heartbeatres)) {
+            fprintf(stderr, "Completed %ld requests\n", done);
+            fflush(stderr);
+            }
+        }
         c->done = apr_time_now();
         s.read = c->read;
         s.starttime = c->start;
@@ -1438,10 +1440,6 @@
     return 0;
 }
 
-static void terminate(void)
-{
-    apr_terminate();
-}
 
 /* ------------------------------------------------------- */
 
@@ -1465,7 +1463,7 @@
     hdrs[0] = '\0';
 
     apr_initialize();
-    atexit(terminate);
+    atexit(apr_terminate);
     apr_pool_create(&cntxt, NULL);
 
 #ifdef NOT_ASCII

Reply via email to