Ticket #2064 (new enhancement)

Opened 3 years ago

Last modified 2 years ago

GeoIP support

Reported by: Piotr K. Owned by: rakshasa
Priority: normal Component: rtorrent
Version: Severity: normal
Keywords: geoip Cc:

Description

Attached is a patch that adds GeoIP (see  http://www.maxmind.com/app/ip-location) support to rTorrent for informational purposes. In Peer list, an additional column with the country code is shown next to the IP address. In the detailed Peer info view, there are three additional rows with country, city and ISP information of the selected peer.

To compile rTorrent with the patch, you need to have the GeoIP library with headers installed. To view all the additional information, you need to have the GeoIP country, city and AS number databases in their default location, most probably /usr/share/GeoIP.

The patch should apply cleanly for rTorrent 0.8.6.

Attachments

geoip.diff.gz Download (2.7 KB) - added by Piotr K. 3 years ago.
GeoIP support
geoip.diff.2.gz Download (2.8 KB) - added by Piotr K. 3 years ago.
GeoIP support, v1.1
geoip.diff.3.gz Download (2.9 KB) - added by Piotr K. 3 years ago.
GeoIP support, v1.2
geoip-isp.diff.gz Download (1.4 KB) - added by Piotr K. 3 years ago.
GeoIPISP support, v1.0, apply after GeoIP patch
geoip-for-ip_filter_no_boost-fast.diff.gz Download (3.1 KB) - added by Piotr K. 3 years ago.
GeoIP patch for ip_filter_no_boost-fast.patch
geoip.diff.4.gz Download (3.0 KB) - added by Piotr K. 3 years ago.
GeoIP support, v1.3
geoip-isp.diff.2.gz Download (1.4 KB) - added by Piotr K. 3 years ago.
GeoIP ISP support, v1.1, apply after GeoIP patch
geoip-rtorrent0.8.9.diff Download (10.5 KB) - added by Piotr K. 2 years ago.
GeoIP for rtorrent 0.8.9

Change History

Changed 3 years ago by Piotr K.

GeoIP support

comment:1 Changed 3 years ago by Piotr K.

One additional note: For the non-ASCII characters of the city and ISP info to be displayed correctly, you have to set your terminal to UTF-8.

comment:2 Changed 3 years ago by anonymous

Any chance this makes it into the official release? Would be highly appreciated.

Thanks Piotr!

comment:3 follow-up: ↓ 4 Changed 3 years ago by rakshasa

Seems like a fluff feature that only adds more code complexity.

comment:4 in reply to: ↑ 3 Changed 3 years ago by anonymous

Replying to rakshasa:

Seems like a fluff feature that only adds more code complexity.

Coming from a dev that considers typo's to be a code revision...

comment:5 Changed 3 years ago by pwn

Awesome! This is great, thanks!

comment:6 follow-up: ↓ 7 Changed 3 years ago by pwn

manager.cc: In member function ‘void core::Manager::init_gi()’: manager.cc:568: error: aggregate ‘std::stringstream msg’ has incomplete type and cannot be defined make[3]: * [manager.o] Error 1 make[3]: Leaving directory `/home/Xeslana/delete/rtorrent-0.8.6/src/core' make[2]: * [all-recursive] Error 1 make[2]: Leaving directory `/home/Xeslana/delete/rtorrent-0.8.6/src' make[1]: * [all-recursive] Error 1 make[1]: Leaving directory `/home/Xeslana/delete/rtorrent-0.8.6' make: * [all] Error 2

:/

comment:7 in reply to: ↑ 6 Changed 3 years ago by Piotr K.

Replying to pwn:

manager.cc: In member function ‘void core::Manager::init_gi()’: manager.cc:568: error: aggregate ‘std::stringstream msg’ has incomplete type and cannot be defined make[3]: * [manager.o] Error 1 make[3]: Leaving directory `/home/Xeslana/delete/rtorrent-0.8.6/src/core' make[2]: * [all-recursive] Error 1 make[2]: Leaving directory `/home/Xeslana/delete/rtorrent-0.8.6/src' make[1]: * [all-recursive] Error 1 make[1]: Leaving directory `/home/Xeslana/delete/rtorrent-0.8.6' make: * [all] Error 2

:/

Add the following at the top of src/core/manager.cc and tell me if it helps:

#include <sstream>

comment:8 Changed 3 years ago by pwn

Piotr,

Thanks, that made some progress but I got another error.

command_peer.cc: In function ‘torrent::Object retrieve_p_city(torrent::Peer*)’: command_peer.cc:104: error: aggregate ‘std::ostringstream s’ has incomplete type and cannot be defined

So I added "#include <sstream>" in command_peer.cc as well and it went furthur. Then I got this error:

/home/Xeslana/delete/rtorrent-0.8.6/src/command_peer.cc:128: undefined reference to `GeoIP_name_by_ipnum' /home/Xeslana/delete/rtorrent-0.8.6/src/command_peer.cc:128: undefined reference to `GeoIP_name_by_ipnum' command_peer.o: In function `retrieve_p_country(torrent::Peer*)': /home/Xeslana/delete/rtorrent-0.8.6/src/command_peer.cc:93: undefined reference to `GeoIP_id_by_ipnum' /home/Xeslana/delete/rtorrent-0.8.6/src/command_peer.cc:94: undefined reference to `GeoIP_country_code' /home/Xeslana/delete/rtorrent-0.8.6/src/command_peer.cc:95: undefined reference to `GeoIP_country_name' command_peer.o: In function `retrieve_p_city(torrent::Peer*)': /home/Xeslana/delete/rtorrent-0.8.6/src/command_peer.cc:109: undefined reference to `GeoIP_record_by_ipnum' /home/Xeslana/delete/rtorrent-0.8.6/src/command_peer.cc:116: undefined reference to `GeoIPRecord_delete' core/libsub_core.a(manager.o): In function `core::Manager::delete_gi()': /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:594: undefined reference to `GeoIP_delete' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:595: undefined reference to `GeoIP_delete' core/libsub_core.a(manager.o): In function `core::Manager::init_gi()': /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:571: undefined reference to `GeoIP_db_avail' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:572: undefined reference to `GeoIP_open_type' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:573: undefined reference to `GeoIP_set_charset' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:577: undefined reference to `GeoIP_db_avail' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:578: undefined reference to `GeoIP_open_type' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:579: undefined reference to `GeoIP_set_charset' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:583: undefined reference to `GeoIP_db_avail' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:584: undefined reference to `GeoIP_open_type' /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:585: undefined reference to `GeoIP_set_charset' core/libsub_core.a(manager.o): In function `core::Manager::delete_gi()': /home/Xeslana/delete/rtorrent-0.8.6/src/core/manager.cc:596: undefined reference to `GeoIP_delete' display/libsub_display.a(window_peer_list.o): In function `display::WindowPeerList::redraw()': /home/Xeslana/delete/rtorrent-0.8.6/src/display/window_peer_list.cc:115: undefined reference to `GeoIP_country_code_by_ipnum' collect2: ld returned 1 exit status

I have the GeoIP development packages installed.

comment:9 Changed 3 years ago by Piotr K.

You probably haven't run autogen.sh after applying the patch and before running configure/make. I'm attaching a revised patch with the missing includes. Thanks for testing.

Changed 3 years ago by Piotr K.

GeoIP support, v1.1

comment:10 follow-up: ↓ 11 Changed 3 years ago by pwn

Piotr,

It works now. Thanks for the great patch.

Support for GeoIPISP (commercial db) will be cool.

comment:11 in reply to: ↑ 10 Changed 3 years ago by Piotr K.

Replying to pwn: [...]

Support for GeoIPISP (commercial db) will be cool.

I don't have access to the commercial GeoIP databases, so this won't happen in the foreseeable future.

comment:12 follow-up: ↓ 13 Changed 3 years ago by anonymous

Hi,

is it possible to combine this patch with the IPfilter patch (ticket 239)? I assume that the line number based replacing may get confused when applying two patches after another? Sorry for the noobish question ...

comment:13 in reply to: ↑ 12 ; follow-up: ↓ 14 Changed 3 years ago by Piotr K.

Replying to anonymous: [...]

is it possible to combine this patch with the IPfilter patch (ticket 239)? I assume that the line number based replacing may get confused when applying two patches after another? Sorry for the noobish question ...

There are several versions of the IPfilter patch. Which one do you have in mind?

comment:14 in reply to: ↑ 13 Changed 3 years ago by anonymous

Replying to Piotr K.:

Replying to anonymous: [...]

is it possible to combine this patch with the IPfilter patch (ticket 239)? I assume that the line number based replacing may get confused when applying two patches after another? Sorry for the noobish question ...

There are several versions of the IPfilter patch. Which one do you have in mind?

The last one ("rtorrent-0.8.6-ip_filter_no_boost-fast.patch"). Albeit I ran into some trouble with this patch as the build failed (last comment in the ticket #239 thread is mine), while I recall an earlier version patching 0.8.4 working fine for me. So I'm waiting for some insight why building 0.8.6 didn't work before looking into applying this GeoIP patch to an ipfilter enabled 0.8.6.

comment:15 Changed 3 years ago by sony

comment:16 Changed 3 years ago by Piotr K.

I'm uploading another version of my patch that, besides some minor changes, makes sure that databases which have been updated are reloaded.

Besides I'm adding a patch that adds support for the commercial GeoIPISP database for those of you who have it. You have to apply it on top of the patch above.

These patches are all for vanilla rTorrent 0.8.6. I may make a patch that will apply cleanly on top of one of the IP filter patches in a few days though.

Changed 3 years ago by Piotr K.

GeoIP support, v1.2

Changed 3 years ago by Piotr K.

GeoIPISP support, v1.0, apply after GeoIP patch

comment:17 Changed 3 years ago by pwn

Works perfectly.

Thanks for the great patches.

comment:18 Changed 3 years ago by Piotr K.

I'm attaching a version of the GeoIP patch that applies cleanly on top of the last IP filter patch (see http://libtorrent.rakshasa.no/attachment/ticket/239/rtorrent-0.8.6-ip_filter_no_boost-fast.patch). You can afterwards also apply the GeoIPISP patch if you like, the current version of it is fine as it is.

Changed 3 years ago by Piotr K.

GeoIP patch for ip_filter_no_boost-fast.patch

comment:19 Changed 3 years ago by Loki

I don't have root on the server where I'm installing rtorrent. I'm installing with --prefix=$HOME. I have geoip installed the same way. The following is the error I get

I ran configure this way:

env LDFLAGS=-L$HOME/lib CPPFLAGS=-I$HOME/include ./configure --prefix=$HOME --with-xmlrpc-c

But during make, this happens:

/bin/sh ../libtool --tag=CXX   --mode=link g++  -g -O2 -g -DDEBUG -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include     -I/home/Loki/include   -I/home/Loki/include   -L/home/Loki/lib -o rtorrent command_download.o command_dynamic.o command_events.o command_file.o command_helpers.o command_local.o command_network.o command_object.o command_peer.o command_tracker.o command_scheduler.o command_ui.o control.o globals.o main.o option_parser.o signal_handler.o thread_base.o ui/libsub_ui.a core/libsub_core.a display/libsub_display.a input/libsub_input.a rpc/libsub_rpc.a utils/libsub_utils.a -lncurses  -lsigc-2.0   -lcurl   -L/home/Loki/lib -ltorrent   -L/home/Loki/lib   -lxmlrpc_server -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok 
libtool: link: g++ -g -O2 -g -DDEBUG -I/usr/include/sigc++-2.0 -I/usr/lib/sigc++-2.0/include -I/home/Loki/include -I/home/Loki/include -o rtorrent command_download.o command_dynamic.o command_events.o command_file.o command_helpers.o command_local.o command_network.o command_object.o command_peer.o command_tracker.o command_scheduler.o command_ui.o control.o globals.o main.o option_parser.o signal_handler.o thread_base.o  -L/home/Loki/lib ui/libsub_ui.a core/libsub_core.a display/libsub_display.a input/libsub_input.a rpc/libsub_rpc.a utils/libsub_utils.a -lncurses /usr/lib/libcurl-gnutls.so /home/Loki/lib/libtorrent.so -lcrypto /usr/lib/libsigc-2.0.so -lxmlrpc_server -lxmlrpc -lxmlrpc_util -lxmlrpc_xmlparse -lxmlrpc_xmltok -Wl,-rpath -Wl,/home/Loki/lib -Wl,-rpath -Wl,/home/Loki/lib
command_peer.o: In function `retrieve_p_asnum(torrent::Peer*)':
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:128: undefined reference to `GeoIP_name_by_ipnum'
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:128: undefined reference to `GeoIP_name_by_ipnum'
command_peer.o: In function `retrieve_p_city(torrent::Peer*)':
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:110: undefined reference to `GeoIP_record_by_ipnum'
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:117: undefined reference to `GeoIPRecord_delete'
command_peer.o: In function `retrieve_p_country(torrent::Peer*)':
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:94: undefined reference to `GeoIP_id_by_ipnum'
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:95: undefined reference to `GeoIP_country_code'
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:96: undefined reference to `GeoIP_country_name'
command_peer.o: In function `retrieve_p_isp(torrent::Peer*)':
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:138: undefined reference to `GeoIP_name_by_ipnum'
/home/Loki/dev/rtorrent-0.8.6/src/command_peer.cc:138: undefined reference to `GeoIP_name_by_ipnum'
core/libsub_core.a(manager.o): In function `core::Manager::delete_gi()':
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:602: undefined reference to `GeoIP_delete'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:603: undefined reference to `GeoIP_delete'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:604: undefined reference to `GeoIP_delete'
core/libsub_core.a(manager.o): In function `core::Manager::init_gi()':
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:573: undefined reference to `GeoIP_db_avail'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:574: undefined reference to `GeoIP_open_type'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:575: undefined reference to `GeoIP_set_charset'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:579: undefined reference to `GeoIP_db_avail'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:580: undefined reference to `GeoIP_open_type'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:581: undefined reference to `GeoIP_set_charset'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:585: undefined reference to `GeoIP_db_avail'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:586: undefined reference to `GeoIP_open_type'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:587: undefined reference to `GeoIP_set_charset'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:591: undefined reference to `GeoIP_db_avail'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:592: undefined reference to `GeoIP_open_type'
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:593: undefined reference to `GeoIP_set_charset'
core/libsub_core.a(manager.o): In function `core::Manager::delete_gi()':
/home/Loki/dev/rtorrent-0.8.6/src/core/manager.cc:605: undefined reference to `GeoIP_delete'
display/libsub_display.a(window_peer_list.o): In function `display::WindowPeerList::redraw()':
/home/Loki/dev/rtorrent-0.8.6/src/display/window_peer_list.cc:115: undefined reference to `GeoIP_country_code_by_ipnum'
collect2: ld returned 1 exit status
make[3]: *** [rtorrent] Error 1
make[3]: Leaving directory `/home/Loki/dev/rtorrent-0.8.6/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/Loki/dev/rtorrent-0.8.6/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/Loki/dev/rtorrent-0.8.6'
make: *** [all] Error 2

Maybe it's a good idea to make the configure script check if GeoIP was detected.

comment:20 Changed 3 years ago by Loki

Sorry, it works fine! I forgot to run autogen.sh before configure.

It works perfectly with GeoIP in nonstandard location.

comment:21 follow-up: ↓ 22 Changed 3 years ago by anonymous

Hello,

I build rtorrent with this patch againt libgeo installed with Macports (with /opt/local/share/GeoIP/GeoIP.dat and geoiplookup) and get the CC's of peers. But somehow it does only read the GeoIP db, not the GeoLiteCity? db I downloaded manually and stored in the same path. Thus I just get infos on the country, nothing more. Any hints how to make either rtorrent or libgeo (before building) aware of the additional database? Or should I use another db than GeoLiteCity??

Thanks in advance!

comment:22 in reply to: ↑ 21 ; follow-up: ↓ 23 Changed 3 years ago by Piotr K.

Replying to anonymous:
[...]

I build rtorrent with this patch againt libgeo installed with Macports (with /opt/local/share/GeoIP/GeoIP.dat and geoiplookup) and get the CC's of peers. But somehow it does only read the GeoIP db, not the GeoLiteCity? db I downloaded manually and stored in the same path. Thus I just get infos on the country, nothing more. Any hints how to make either rtorrent or libgeo (before building) aware of the additional database? Or should I use another db than GeoLiteCity??

[...]

I think it's because libGeoIP doesn't actually look for GeoLiteCity?.dat but only the commercial GeoIPCity.dat. Geoiplookup should have the same issue you're describing, i.e. not showing city info. Try linking GeoIPCity.dat to GeoLiteCity?.dat, that should help.
(And where does the question mark behind GeoLiteCity? come from?)

comment:23 in reply to: ↑ 22 ; follow-up: ↓ 24 Changed 3 years ago by anonymous

Replying to Piotr K.:

Replying to anonymous:
[...]

I build rtorrent with this patch againt libgeo installed with Macports (with /opt/local/share/GeoIP/GeoIP.dat and geoiplookup) and get the CC's of peers. But somehow it does only read the GeoIP db, not the GeoLiteCity? db I downloaded manually and stored in the same path. Thus I just get infos on the country, nothing more. Any hints how to make either rtorrent or libgeo (before building) aware of the additional database? Or should I use another db than GeoLiteCity??

[...]

I think it's because libGeoIP doesn't actually look for GeoLiteCity?.dat but only the commercial GeoIPCity.dat. Geoiplookup should have the same issue you're describing, i.e. not showing city info. Try linking GeoIPCity.dat to GeoLiteCity?.dat, that should help.

Your assumption was correct, I did link GeoLiteCity?.dat to GeoIPCity.dat, now both rtorrent (no recompiling) and geoiplookup fetch city information from said db. Still got no AS info, though, but Maxmind probably restricts that to paying customers. Or are there other free db's available?

(And where does the question mark behind GeoLiteCity? come from?)

Probably some trac build in stuff, just like automatically linking hash followed by a number to tickets.

comment:24 in reply to: ↑ 23 Changed 3 years ago by anonymous

Replying to anonymous:

[...]

Your assumption was correct, I did link GeoLiteCity?.dat to GeoIPCity.dat, now both rtorrent (no recompiling) and geoiplookup fetch city information from said db. Still got no AS info, though, but Maxmind probably restricts that to paying customers. Or are there other free db's available?

[...]

ASNum db is free and available from  http://geolite.maxmind.com/download/geoip/database/asnum/. Just unpack it, no linking is necessary.

comment:25 Changed 3 years ago by perlcopter <whoreperl@gmail.com>

Rename GeoLiteCity?.dat to GeoIPCity.dat and it'll work.

comment:26 Changed 3 years ago by Piotr K.

I'm attaching updated versions of my GeoIP patches for vanilla rTorrent 0.8.6. They basically fix a NULL pointer dereference in case a given IP address is not in the databases.

First apply geoip.diff.4.gz, then geoip-isp.diff.2.gz if you have the commercial ISP database. Don't forget to run ./autogen.sh before running ./configure.

Cheers, Piotr

Changed 3 years ago by Piotr K.

GeoIP support, v1.3

Changed 3 years ago by Piotr K.

GeoIP ISP support, v1.1, apply after GeoIP patch

comment:27 Changed 3 years ago by anonymous

Works great on Linux but having trouble with this patch on Windows.

manager.cc: In member function ‘void core::Manager::init_gi()’: manager.cc:575: error: ‘GEOIP_MMAP_CACHE’ was not declared in this scope manager.cc:576: error: ‘GEOIP_CHARSET_UTF8’ was not declared in this scope manager.cc:576: error: ‘GeoIP_set_charset’ was not declared in this scope manager.cc:581: error: ‘GEOIP_MMAP_CACHE’ was not declared in this scope manager.cc:582: error: ‘GEOIP_CHARSET_UTF8’ was not declared in this scope manager.cc:582: error: ‘GeoIP_set_charset’ was not declared in this scope manager.cc:587: error: ‘GEOIP_MMAP_CACHE’ was not declared in this scope manager.cc:588: error: ‘GEOIP_CHARSET_UTF8’ was not declared in this scope manager.cc:588: error: ‘GeoIP_set_charset’ was not declared in this scope manager.cc:593: error: ‘GEOIP_MMAP_CACHE’ was not declared in this scope manager.cc:594: error: ‘GEOIP_CHARSET_UTF8’ was not declared in this scope manager.cc:594: error: ‘GeoIP_set_charset’ was not declared in this scope

Removing GEOIP_MMAP_CACHE and commenting out the GeoIP_set_charset line fixed it but is there an equivalent for those lines on windows?

comment:28 Changed 3 years ago by anonymous

Also have this error on Windows

command_peer.cc: In function ‘torrent::Object retrieve_p_city(torrent::Peer*)’: command_peer.cc:112: error: ‘struct GeoIPRecordTag’ has no member named ‘continent_code’ command_peer.cc:115: error: ‘struct GeoIPRecordTag’ has no member named ‘metro_code’

comment:29 Changed 3 years ago by anonymous

Sorry, my GeoIP was too old. Updated to latest version and this patch worked perfectly on Cygwin.

comment:30 follow-up: ↓ 31 Changed 3 years ago by anonymous

Hello,

I used this patch on 0.8.6. Would it be possible to port it to the new 0.8.7 release? At the moment it doesn't work, the problematic files seem to be: src/command_peer.cc src/core/manager.cc src/ui/element_peer_list.cc

And another thing: When I use GeoIP.dat (lite), GeoCityLite? and GeoASNum, sometimes the GeoIP.dat doesn't hold information about an IP, while the others do. In that case, no country code is displayed in the list of peers (CC column has no entry). But in the detailed view it is available in the GeoCity?(Lite) row. So would it be possible to add a fallback-routine, that fetches the information about the CC from the GeoCity? db and puts it in the colum "CC" in the peer list?

comment:31 in reply to: ↑ 30 ; follow-up: ↓ 32 Changed 3 years ago by Piotr K.

Replying to anonymous:

Hello,

I used this patch on 0.8.6. Would it be possible to port it to the new 0.8.7 release? At the moment it doesn't work, the problematic files seem to be: src/command_peer.cc src/core/manager.cc src/ui/element_peer_list.cc

I'll probably won't update the patch until 0.8.7 becomes stable.

And another thing: When I use GeoIP.dat (lite), GeoCityLite? and GeoASNum, sometimes the GeoIP.dat doesn't hold information about an IP, while the others do. In that case, no country code is displayed in the list of peers (CC column has no entry). But in the detailed view it is available in the GeoCity?(Lite) row. So would it be possible to add a fallback-routine, that fetches the information about the CC from the GeoCity? db and puts it in the colum "CC" in the peer list?

Hmm, city info in the detailed peer view does not display any country information right now. Can you give a sample IP that is affected by the problem you describe?

comment:32 in reply to: ↑ 31 Changed 3 years ago by anonymous

Replying to Piotr K.:

Replying to anonymous:

Hello,

I used this patch on 0.8.6. Would it be possible to port it to the new 0.8.7 release? At the moment it doesn't work, the problematic files seem to be: src/command_peer.cc src/core/manager.cc src/ui/element_peer_list.cc

I'll probably won't update the patch until 0.8.7 becomes stable.

Fair enough!

And another thing: When I use GeoIP.dat (lite), GeoCityLite? and GeoASNum, sometimes the GeoIP.dat doesn't hold information about an IP, while the others do. In that case, no country code is displayed in the list of peers (CC column has no entry). But in the detailed view it is available in the GeoCity?(Lite) row. So would it be possible to add a fallback-routine, that fetches the information about the CC from the GeoCity? db and puts it in the colum "CC" in the peer list?

Hmm, city info in the detailed peer view does not display any country information right now. Can you give a sample IP that is affected by the problem you describe?

I rechecked, and the IP I did notice this problem first seems ok now. Thus I think that maybe the problem was related to GeoIP and GeoCity? being "out of sync", i.e. that GeoCity? was up to date, will GeoIP was outdated. If I run into that issue again, I'll post asap. When I said:

But in the detailed view it is available in the GeoCity?(Lite) row.

I ment that the GeoIPCity db did hold info about that peer and showed it in that row (f.e. the location "Lund", which is a city in Sweden), even if GeoIP db, for whatever reason, didn't hold info about that peer. But there is no CC in that GeoIPCity row, granted. However, when I do a "geoiplookup" in the shell, I get a row for every db the lookup uses (i.e. GeoIP.dat and GeoCity?.dat give two rows). And the row for the GeoCity?.dat contains a CC code. So I was thinking that the GeoCity?.dat still contains CC info, even if it's not displayed in the "detailed peer view" in rtorrent. Which, of course, would be totally redundant if GeoIP.dat and GeoIPCity.dat indeed always are in sync. Sorry for the mix up!

comment:33 Changed 2 years ago by do.it@i.ua

If anyone needs an amd64 rtorrent 0.8.6 package for Debian Squeeze, integrating #239 (ipfilter), #2171 (mod-canvas) and #2064 (GeoIP) - I made one, but can't post a direct link (hit the spam blocker). Try googling for "rtorrent-enhanced-with-ipfilter-and-geoip-debian-squeeze-amd64-package".

comment:34 Changed 2 years ago by Piotr K.

I'm posting an updated version of my GeoIP patch that works with rtorrent 0.8.9. Don't forget to run autogen.sh after patching.

Changed 2 years ago by Piotr K.

GeoIP for rtorrent 0.8.9

Note: See TracTickets for help on using tickets.