--------------------- PatchSet 10666 Date: 2008/07/18 08:20:09 Author: adri Branch: delay_pool_write Tag: (none) Log: Pass in the delay pool id into the Updates routines so the class5 pool can only updates its fds. Members: src/delay_pools.c:1.21.4.8->1.21.4.9 Index: squid/src/delay_pools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/delay_pools.c,v retrieving revision 1.21.4.8 retrieving revision 1.21.4.9 diff -u -r1.21.4.8 -r1.21.4.9 --- squid/src/delay_pools.c 18 Jul 2008 08:07:44 -0000 1.21.4.8 +++ squid/src/delay_pools.c 18 Jul 2008 08:20:09 -0000 1.21.4.9 @@ -1,6 +1,6 @@ /* - * $Id: delay_pools.c,v 1.21.4.8 2008/07/18 08:07:44 adri Exp $ + * $Id: delay_pools.c,v 1.21.4.9 2008/07/18 08:20:09 adri Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: David Luyer @@ -549,7 +549,7 @@ } static void -delayUpdateClass1(class1DelayPool * class1, delaySpecSet * rates, int incr) +delayUpdateClass1(class1DelayPool * class1, char pool, delaySpecSet * rates, int incr) { /* delaySetSpec may be pointer to partial structure so MUST pass by * reference. @@ -561,7 +561,7 @@ } static void -delayUpdateClass5(class5DelayPool *class5, delaySpecSet * rates, int incr) +delayUpdateClass5(class5DelayPool *class5, char pool, delaySpecSet * rates, int incr) { int restore_bytes; int fd; @@ -577,6 +577,8 @@ /* Update per-FD allowances */ assert(Biggest_FD < class5->fds_size); for (fd = 0; fd < Biggest_FD; fd++) { + if (delay_class_5_fds[fd] != (pool + 1)) + continue; class5->fds[fd].aggregate += restore_bytes; if (class5->fds[fd].aggregate > rates->individual.max_bytes) class5->fds[fd].aggregate = rates->individual.max_bytes; @@ -584,7 +586,7 @@ } static void -delayUpdateClass2(class2DelayPool * class2, delaySpecSet * rates, int incr) +delayUpdateClass2(class2DelayPool * class2, char pool, delaySpecSet * rates, int incr) { int restore_bytes; unsigned char i; /* depends on 255 + 1 = 0 */ @@ -614,7 +616,7 @@ } static void -delayUpdateClass3(class3DelayPool * class3, delaySpecSet * rates, int incr) +delayUpdateClass3(class3DelayPool * class3, char pool, delaySpecSet * rates, int incr) { int individual_restore_bytes, network_restore_bytes; int mpos; @@ -696,16 +698,16 @@ continue; switch (class) { case 1: - delayUpdateClass1(delay_data[i].class1, Config.Delay.rates[i], incr); + delayUpdateClass1(delay_data[i].class1, i, Config.Delay.rates[i], incr); break; case 2: - delayUpdateClass2(delay_data[i].class2, Config.Delay.rates[i], incr); + delayUpdateClass2(delay_data[i].class2, i, Config.Delay.rates[i], incr); break; case 3: - delayUpdateClass3(delay_data[i].class3, Config.Delay.rates[i], incr); + delayUpdateClass3(delay_data[i].class3, i, Config.Delay.rates[i], incr); break; case 5: - delayUpdateClass5(delay_data[i].class5, Config.Delay.rates[i], incr); + delayUpdateClass5(delay_data[i].class5, i, Config.Delay.rates[i], incr); break; default: assert(0);