support for wide character paths for the GeoIP databases. Fixes #431

This commit is contained in:
Arvid Norberg
2008-12-21 08:48:06 +00:00
parent 8a0fa577b1
commit 7b8663fa8b
6 changed files with 54 additions and 0 deletions

View File

@@ -134,7 +134,9 @@ The ``session`` class has the following synopsis::
int num_connections() const;
bool load_asnum_db(char const* file);
bool load_asnum_db(wchar_t const* file);
bool load_country_db(char const* file);
bool load_country_db(wchar_t const* file);
int as_for_ip(address const& adr);
void load_state(entry const& ses_state);
@@ -470,7 +472,9 @@ load_asnum_db() load_country_db() int as_for_ip()
::
bool load_asnum_db(char const* file);
bool load_asnum_db(wchar_t const* file);
bool load_country_db(char const* file);
bool load_country_db(wchar_t const* file);
int as_for_ip(address const& adr);
These functions are not available if ``TORRENT_DISABLE_GEO_IP`` is defined. They
@@ -480,6 +484,8 @@ respectively. This will be used to look up which AS and country peers belong to.
``as_for_ip`` returns the AS number for the IP address specified. If the IP is not
in the database or the ASN database is not loaded, 0 is returned.
The ``wchar_t`` overloads are for wide character paths.
.. _`MaxMind ASN database`: http://www.maxmind.com/app/asnum
.. _`MaxMind GeoIP database`: http://www.maxmind.com/app/geolitecountry