From 859e38b5452e2594f5c9e7154cb5acee3d0b4309 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Tue, 17 Nov 2009 19:04:48 +0000 Subject: [PATCH] (bug 21551) Make Squid response limit configurable. Patch by Roi Aminoam --- CREDITS | 1 + RELEASE-NOTES | 1 + includes/DefaultSettings.php | 5 +++++ includes/SquidUpdate.php | 4 ++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CREDITS b/CREDITS index 37f036528e..3e8646eb87 100644 --- a/CREDITS +++ b/CREDITS @@ -106,6 +106,7 @@ following names for their contribution to the product. * René Kijewski * Robert Treat * RockMFR +* Roi Avinoam * Sam Reed * ST47 * Scott Colcord diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 80595432fc..38acde8d8f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -637,6 +637,7 @@ Hopefully we will remove this configuration var soon) * (bug 19391) Fix caching for Recent ChangesFeed. * (bug 21455) Fixed "Watch this page" checkbox appearing on some special pages even to non-logged in users +* (bug 21551) Make Squid reponse limit configurable == API changes in 1.16 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c8e55c4275..153df60522 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1769,6 +1769,11 @@ $wgSquidServers = array(); */ $wgSquidServersNoPurge = array(); +/** + * Default character limit for squid purge responses + */ +$wgSquidResponseLimit = 250; + /** Maximum number of titles to purge in any one client operation */ $wgMaxSquidPurgeTitles = 400; diff --git a/includes/SquidUpdate.php b/includes/SquidUpdate.php index b8b28ea9e3..1323ffad39 100644 --- a/includes/SquidUpdate.php +++ b/includes/SquidUpdate.php @@ -81,7 +81,7 @@ class SquidUpdate { XXX report broken Squids per mail or log */ static function purge( $urlArr ) { - global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort; + global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort, $wgSquidResponseLimit; /*if ( (@$wgSquidServers[0]) == 'echo' ) { echo implode("
\n", $urlArr) . "
\n"; @@ -140,7 +140,7 @@ class SquidUpdate { #$this->debug("\n"); /* Squid only returns http headers with 200 or 404 status, if there's more returned something's wrong */ - if (strlen($res) > 250) { + if (strlen($res) > $wgSquidResponseLimit) { fclose($socket); $failed = true; $totalsockets -= $sockspersq; -- 2.20.1