Index: ab.c =================================================================== --- ab.c (revision 421810) +++ ab.c (working copy) @@ -802,21 +802,21 @@ double sdtot = 0, sdcon = 0, sdd = 0, sdwait = 0; for (i = 0; i < requests; i++) { - struct data s = stats[i]; - mincon = ap_min(mincon, s.ctime); - mintot = ap_min(mintot, s.time); - mind = ap_min(mind, s.time - s.ctime); - minwait = ap_min(minwait, s.waittime); + struct data * s = &stats[i]; + mincon = ap_min(mincon, s->ctime); + mintot = ap_min(mintot, s->time); + mind = ap_min(mind, s->time - s->ctime); + minwait = ap_min(minwait, s->waittime); - maxcon = ap_max(maxcon, s.ctime); - maxtot = ap_max(maxtot, s.time); - maxd = ap_max(maxd, s.time - s.ctime); - maxwait = ap_max(maxwait, s.waittime); + maxcon = ap_max(maxcon, s->ctime); + maxtot = ap_max(maxtot, s->time); + maxd = ap_max(maxd, s->time - s->ctime); + maxwait = ap_max(maxwait, s->waittime); - totalcon += s.ctime; - total += s.time; - totald += s.time - s.ctime; - totalwait += s.waittime; + totalcon += s->ctime; + total += s->time; + totald += s->time - s->ctime; + totalwait += s->waittime; } meancon = totalcon / requests; meantot = total / requests; @@ -825,15 +825,15 @@ /* calculating the sample variance: the sum of the squared deviations, divided by n-1 */ for (i = 0; i < requests; i++) { - struct data s = stats[i]; + struct data * s = &stats[i]; double a; - a = ((double)s.time - meantot); + a = ((double)s->time - meantot); sdtot += a * a; - a = ((double)s.ctime - meancon); + a = ((double)s->ctime - meancon); sdcon += a * a; - a = ((double)s.time - (double)s.ctime - meand); + a = ((double)s->time - (double)s->ctime - meand); sdd += a * a; - a = ((double)s.waittime - meanwait); + a = ((double)s->waittime - meanwait); sdwait += a * a; } @@ -1076,13 +1076,13 @@ apr_interval_time_t maxcon = 0, maxtot = 0; for (i = 0; i < requests; i++) { - struct data s = stats[i]; - mincon = ap_min(mincon, s.ctime); - mintot = ap_min(mintot, s.time); - maxcon = ap_max(maxcon, s.ctime); - maxtot = ap_max(maxtot, s.time); - totalcon += s.ctime; - total += s.time; + struct data * s = &stats[i]; + mincon = ap_min(mincon, s->ctime); + mintot = ap_min(mintot, s->time); + maxcon = ap_max(maxcon, s->ctime); + maxtot = ap_max(maxtot, s->time); + totalcon += s->ctime; + total += s->time; } if (requests > 0) { /* avoid division by zero (if 0 requests) */ @@ -1245,18 +1245,18 @@ } /* save out time */ if (done < requests) { - struct data s; + struct data * s = &stats[done]; if ((done) && heartbeatres && !(done % heartbeatres)) { fprintf(stderr, "Completed %ld requests\n", done); fflush(stderr); } c->done = apr_time_now(); - s.read = c->read; - s.starttime = c->start; - s.ctime = ap_max(0, (c->connect - c->start) / 1000); - s.time = ap_max(0, (c->done - c->start) / 1000); - s.waittime = ap_max(0, (c->beginread - c->endwrite) / 1000); - stats[done++] = s; + s->read = c->read; + s->starttime = c->start; + s->ctime = ap_max(0, (c->connect - c->start) / 1000); + s->time = ap_max(0, (c->done - c->start) / 1000); + s->waittime = ap_max(0, (c->beginread - c->endwrite) / 1000); + ++done; } } @@ -1480,19 +1480,19 @@ err_length++; } if (done < requests) { - struct data s; + struct data * s = &stats[done]; doneka++; if (done && heartbeatres && !(done % heartbeatres)) { fprintf(stderr, "Completed %ld requests\n", done); fflush(stderr); } c->done = apr_time_now(); - s.read = c->read; - s.starttime = c->start; - s.ctime = ap_max(0, (c->connect - c->start) / 1000); - s.waittime = ap_max(0, (c->beginread - c->endwrite) / 1000); - s.time = ap_max(0, (c->done - c->start) / 1000); - stats[done++] = s; + s->read = c->read; + s->starttime = c->start; + s->ctime = ap_max(0, (c->connect - c->start) / 1000); + s->waittime = ap_max(0, (c->beginread - c->endwrite) / 1000); + s->time = ap_max(0, (c->done - c->start) / 1000); + ++done; } c->keepalive = 0; c->length = 0;