|
@@ 1517-1535 (lines=19) @@
|
| 1514 |
|
|
| 1515 |
|
$offset = 0; |
| 1516 |
|
for ( $depth = 127; $depth >= 0; --$depth ) { |
| 1517 |
|
if ( $this->flags & self::GEOIP_MEMORY_CACHE ) { |
| 1518 |
|
$buf = $this->_safe_substr( |
| 1519 |
|
$this->memory_buffer, |
| 1520 |
|
2 * $this->record_length * $offset, |
| 1521 |
|
2 * $this->record_length |
| 1522 |
|
); |
| 1523 |
|
} elseif ( $this->flags & self::GEOIP_SHARED_MEMORY ) { |
| 1524 |
|
$buf = @shmop_read( |
| 1525 |
|
$this->shmid, |
| 1526 |
|
2 * $this->record_length * $offset, |
| 1527 |
|
2 * $this->record_length |
| 1528 |
|
); |
| 1529 |
|
} else { |
| 1530 |
|
if ( 0 != fseek( $this->filehandle, 2 * $this->record_length * $offset, SEEK_SET ) ) { |
| 1531 |
|
break; |
| 1532 |
|
} |
| 1533 |
|
|
| 1534 |
|
$buf = fread( $this->filehandle, 2 * $this->record_length ); |
| 1535 |
|
} |
| 1536 |
|
$x = array( 0, 0 ); |
| 1537 |
|
for ( $i = 0; $i < 2; ++$i ) { |
| 1538 |
|
for ( $j = 0; $j < $this->record_length; ++$j ) { |
|
@@ 1573-1591 (lines=19) @@
|
| 1570 |
|
private function _geoip_seek_country( $ipnum ) { |
| 1571 |
|
$offset = 0; |
| 1572 |
|
for ( $depth = 31; $depth >= 0; --$depth ) { |
| 1573 |
|
if ( $this->flags & self::GEOIP_MEMORY_CACHE ) { |
| 1574 |
|
$buf = $this->_safe_substr( |
| 1575 |
|
$this->memory_buffer, |
| 1576 |
|
2 * $this->record_length * $offset, |
| 1577 |
|
2 * $this->record_length |
| 1578 |
|
); |
| 1579 |
|
} elseif ( $this->flags & self::GEOIP_SHARED_MEMORY ) { |
| 1580 |
|
$buf = @shmop_read( |
| 1581 |
|
$this->shmid, |
| 1582 |
|
2 * $this->record_length * $offset, |
| 1583 |
|
2 * $this->record_length |
| 1584 |
|
); |
| 1585 |
|
} else { |
| 1586 |
|
if ( 0 != fseek( $this->filehandle, 2 * $this->record_length * $offset, SEEK_SET ) ) { |
| 1587 |
|
break; |
| 1588 |
|
} |
| 1589 |
|
|
| 1590 |
|
$buf = fread( $this->filehandle, 2 * $this->record_length ); |
| 1591 |
|
} |
| 1592 |
|
|
| 1593 |
|
$x = array( 0, 0 ); |
| 1594 |
|
for ( $i = 0; $i < 2; ++$i ) { |