Speed up CIDR matching from $wgSquidServersNoPurge
authorBrandon Black <bblack@wikimedia.org>
Tue, 6 May 2014 18:49:26 +0000 (13:49 -0500)
committerOri.livneh <ori@wikimedia.org>
Thu, 15 May 2014 17:23:12 +0000 (17:23 +0000)
commite323bc33934de4f85161d1f6338aa73810b79cc9
tree57e6ba3b6e514b0facdc18e127fff570c6c7152f
parentd2effb755b5dee8fd93af991766b847979365ce7
Speed up CIDR matching from $wgSquidServersNoPurge

This adds a new generic library class IPSet, which precomputes
a reasonably-efficient data structure from the input list of
addresses and CIDR net/mask specs for fast runtime matching,
and then uses it to check trusted XFF-setters.

See also: 32b4f19f173fc5cff1029eedee63a39a2d72dd3a
Bug: 57021
Change-Id: Ia3b12fb90c3e7e492374a128943b014481cc2730
includes/AutoLoader.php
includes/Block.php
includes/GlobalFunctions.php
includes/WebRequest.php
includes/libs/IPSet.php [new file with mode: 0644]
includes/utils/IP.php
tests/phpunit/includes/WebRequestTest.php
tests/phpunit/includes/libs/IPSetTest.php [new file with mode: 0644]
tests/phpunit/phpunit.php