You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by je...@apache.org on 2006/04/18 00:24:22 UTC
svn commit: r394790 - in /httpd/test/trunk/flood: CHANGES flood_farm.c
Author: jerenkrantz
Date: Mon Apr 17 15:24:19 2006
New Revision: 394790
URL: http://svn.apache.org/viewcvs?rev=394790&view=rev
Log:
Fix corruption when we have multiple usefarmer's without a count.
* flood_farm.c
(run_farm): If we don't see a count attribute, increment by one.
Modified:
httpd/test/trunk/flood/CHANGES
httpd/test/trunk/flood/flood_farm.c
Modified: httpd/test/trunk/flood/CHANGES
URL: http://svn.apache.org/viewcvs/httpd/test/trunk/flood/CHANGES?rev=394790&r1=394789&r2=394790&view=diff
==============================================================================
--- httpd/test/trunk/flood/CHANGES (original)
+++ httpd/test/trunk/flood/CHANGES Mon Apr 17 15:24:19 2006
@@ -1,5 +1,8 @@
Changes since 1.0:
+* Fix corruption when we have multiple usefarmer's without a count.
+ [Justin Erenkrantz]
+
* Sync with latest find_apr.m4 and find_apu.m4 to detect 1.0 APR and APR-util.
[Justin Erenkrantz]
Modified: httpd/test/trunk/flood/flood_farm.c
URL: http://svn.apache.org/viewcvs/httpd/test/trunk/flood/flood_farm.c?rev=394790&r1=394789&r2=394790&view=diff
==============================================================================
--- httpd/test/trunk/flood/flood_farm.c (original)
+++ httpd/test/trunk/flood/flood_farm.c Mon Apr 17 15:24:19 2006
@@ -151,12 +151,17 @@
usefarmer_count = 0;
for (e = farm_elem->first_child; e; e = e->next) {
if (strncasecmp(e->name, XML_FARM_USEFARMER, FLOOD_STRLEN_MAX) == 0) {
+ int found_count = 0;
for (use_elem = e->attr; use_elem; use_elem = use_elem->next) {
if (use_elem->name &&
strncasecmp(use_elem->name, XML_FARM_USEFARMER_COUNT,
FLOOD_STRLEN_MAX) == 0) {
+ found_count = 1;
usefarmer_count += strtol(use_elem->value, NULL, 10);
}
+ }
+ if (!found_count) {
+ usefarmer_count++;
}
}
}