(bug 21551) Make Squid response limit configurable. Patch by Roi Aminoam
authorRoan Kattouw <catrope@users.mediawiki.org>
Tue, 17 Nov 2009 19:04:48 +0000 (19:04 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Tue, 17 Nov 2009 19:04:48 +0000 (19:04 +0000)
CREDITS
RELEASE-NOTES
includes/DefaultSettings.php
includes/SquidUpdate.php

diff --git a/CREDITS b/CREDITS
index 37f0365..3e8646e 100644 (file)
--- 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
index 8059543..38acde8 100644 (file)
@@ -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 ==
 
index c8e55c4..153df60 100644 (file)
@@ -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;
 
index b8b28ea..1323ffa 100644 (file)
@@ -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("<br />\n", $urlArr) . "<br />\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;