]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 13 Feb 2013 23:47:22 +0000 (00:47 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 13 Feb 2013 23:47:22 +0000 (00:47 +0100)
1  2 
website/reverse.php

diff --combined website/reverse.php
index 434b5bd10daed928a18ef1ba24b705091bf09dee,33e6cd5e638b4986469a3bc1bf4168472c348177..c348659e25d02fd7cdc136d223ad9b877bd20cd8
@@@ -4,22 -4,6 +4,22 @@@
        require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
  
 +    if (preg_match(CONST_BlockedUserAgents, $_SERVER["HTTP_USER_AGENT"]) > 0)
 +    {
 +        $fLoadAvg = getLoadAverage();
 +        if ($fLoadAvg >= CONST_BlockReverseMaxLoad) {
 +            header('HTTP/1.0 403 Forbidden');
 +            header('Content-type: text/html; charset=utf-8');
 +              echo "<html><body><h1>App temporarily blocked</h1>";
 +            echo "Your application has been temporarily blocked from the OpenStreetMap Nominatim ";
 +            echo "geolocation service due to high server load.";
 +            echo "\n</body></html>\n";
 +            exit;
 +        }
 +
 +    }
 +
 +
          if (strpos(CONST_BulkUserIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false)
          {
                  $fLoadAvg = getLoadAverage();
@@@ -91,7 -75,7 +91,7 @@@
                $iMaxRank = (isset($_GET['zoom']) && isset($aZoomRank[$_GET['zoom']]))?$aZoomRank[$_GET['zoom']]:28;
  
                // Find the nearest point
-               $fSearchDiam = 0.0001;
+               $fSearchDiam = 0.0004;
                $iPlaceID = null;
                $aArea = false;
                $fMaxAreaDistance = 1;