Index: trunk/phase3/includes/memcached-client.php |
— | — | @@ -795,11 +795,6 @@ |
796 | 796 | $realkey = is_array($key) ? $key[1] : $key; |
797 | 797 | for ($tries = 0; $tries<20; $tries++) |
798 | 798 | { |
799 | | - // temp logging for strange bug |
800 | | - if( !isset($this->_buckets[$hv % $this->_bucketcount]) ) { |
801 | | - wfDebugLog( "memcached", "Invalid bucket hash '$hv' from key '$realkey' given!" ); |
802 | | - continue; |
803 | | - } |
804 | 799 | $host = $this->_buckets[$hv % $this->_bucketcount]; |
805 | 800 | $sock = $this->sock_to_host($host); |
806 | 801 | if (is_resource($sock)) { |
— | — | @@ -807,6 +802,7 @@ |
808 | 803 | return $sock; |
809 | 804 | } |
810 | 805 | $hv += $this->_hashfunc($tries . $realkey); |
| 806 | + $hv = $hv & 0x7fffffff; // don't let this pass the limit and go negative (bug 12342) |
811 | 807 | } |
812 | 808 | |
813 | 809 | return false; |