r59178 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59177‎ | r59178 | r59179 >
Date:19:04, 17 November 2009
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
(bug 21551) Make Squid response limit configurable. Patch by Roi Aminoam
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/SquidUpdate.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -106,6 +106,7 @@
107107 * René Kijewski
108108 * Robert Treat
109109 * RockMFR
 110+* Roi Avinoam
110111 * Sam Reed
111112 * ST47
112113 * Scott Colcord
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1769,6 +1769,11 @@
17701770 */
17711771 $wgSquidServersNoPurge = array();
17721772
 1773+/**
 1774+ * Default character limit for squid purge responses
 1775+ */
 1776+$wgSquidResponseLimit = 250;
 1777+
17731778 /** Maximum number of titles to purge in any one client operation */
17741779 $wgMaxSquidPurgeTitles = 400;
17751780
Index: trunk/phase3/includes/SquidUpdate.php
@@ -81,7 +81,7 @@
8282 XXX report broken Squids per mail or log */
8383
8484 static function purge( $urlArr ) {
85 - global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort;
 85+ global $wgSquidServers, $wgHTCPMulticastAddress, $wgHTCPPort, $wgSquidResponseLimit;
8686
8787 /*if ( (@$wgSquidServers[0]) == 'echo' ) {
8888 echo implode("<br />\n", $urlArr) . "<br />\n";
@@ -140,7 +140,7 @@
141141 #$this->debug("\n");
142142 /* Squid only returns http headers with 200 or 404 status,
143143 if there's more returned something's wrong */
144 - if (strlen($res) > 250) {
 144+ if (strlen($res) > $wgSquidResponseLimit) {
145145 fclose($socket);
146146 $failed = true;
147147 $totalsockets -= $sockspersq;
Index: trunk/phase3/RELEASE-NOTES
@@ -637,6 +637,7 @@
638638 * (bug 19391) Fix caching for Recent ChangesFeed.
639639 * (bug 21455) Fixed "Watch this page" checkbox appearing on some special pages
640640 even to non-logged in users
 641+* (bug 21551) Make Squid reponse limit configurable
641642
642643 == API changes in 1.16 ==
643644

Follow-up revisions

RevisionCommit summaryAuthorDate
r62005* (bug 21551) Rewrote the Squid purge HTTP client to provide a more robust an...tstarling03:36, 5 February 2010

Comments

#Comment by Tim Starling (talk | contribs)   02:11, 12 January 2010

What a terrible way to detect an error status. Talk about hacks piled on top of hacks. Just running a regex on the first line of the result would be enough to extract the response code and put this on solid ground.

Status & tagging log