search for: max_asn_record_length

Displaying 1 result from an estimated 1 matches for "max_asn_record_length".

2009 Nov 07
1
Fwd: [PATCH (geoip)] use IO.pread from the io-extra lib if possible
...throw "Invalid GeoIP database type, can''t look up ASN by IP" end pos = seek_record(ipnum); - record = "" - @mutex.synchronize { - @file.seek(pos + (2*@record_length-1) * @databaseSegments[0]) - record = @file.read(MAX_ASN_RECORD_LENGTH) - } + off = pos + (2*@record_length-1) * @databaseSegments[0] + record = atomic_read(MAX_ASN_RECORD_LENGTH, off) record = record.sub(/\000.*/n, '''') if record =~ /^(AS\d+)\s(.*)$/ @@ -739,10 +736,8 @@ class GeoIP offset = 0...