turbobytes / geoipdb

GeoIP related related helper functions for TurboBytes stack
MIT License
0 stars 2 forks source link

Implement LookupAsn as a replacement of getasn in cnc.go #6

Closed coolparadox closed 7 years ago

coolparadox commented 7 years ago

@sajal LookupAsn does not implement cache nor queries to our own database yet (these will be further issues).

Fixes #1

sajal commented 7 years ago

https://github.com/turbobytes/geoipdb/pull/6/files#diff-7563c91ce4ebe025939e52d29001b48eR225

I see you are using locks there. We do not want to do that. This will make lookups sequential and slow. Imagine if each lookup takes 2 seconds, then we are stuck with doing 1 lookup per 2 seconds. A single test result might require 100s of lookups at a time. It is fine to create new dns.Msg for each lookup, and let garbage collector deal with it.