libktorrent: HTTP Proxy is ignored

Review Request #130037 - Created March 20, 2017 and updated

Information
Alexander Trufanov
libktorrent
master
377822
Reviewers
ktorrent
aacid, shaforo

In KTorrent 5.0 the HTTP Proxy setting is ignored due to problem in libktorrent's HTTPTracker::doAnnounce() in case of KIO transport.
I have privoxy on top of tor, both on my local machine, and I don't see any traffic to my proxy in its log. Also https://torguard.net/checkmytorrentipaddress.php displays my real ip.

It seems the problem is that you must set up "ProxyUrls" metadata and current implementation fills in only "UseProxy". Looks like KIO ignores proxy setting in this case. Perhaps it's a KIO problem. Didn't dig deeper.

After setting "ProxyUrls" equal to "UseProxy" avarything seems to get working as expected.

UPD.: I tend to think that "UseProxy" is ignored if no "ProxyUrls" is set or overwrited with "ProxyUrls" even if "ProxyUrls" is empty. If i'm looking at right code line... At least it works if I comment out md["UseProxy"] = p; and leave only "ProxyUrls".

UPD3: Another KIO problem that was referenced here was solved under https://git.reviewboard.kde.org/r/130040/


  

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Alexander Trufanov
Alexander Trufanov
Alexander Trufanov
Anthony Fieroni
Alexander Trufanov
Alexander Trufanov
Alexander Trufanov
Review request changed

Change Summary:

UPD2 removed as investigated and solved in another review.

Description:

   

In KTorrent 5.0 the HTTP Proxy setting is ignored due to problem in libktorrent's HTTPTracker::doAnnounce() in case of KIO transport.

    I have privoxy on top of tor, both on my local machine, and I don't see any traffic to my proxy in its log. Also https://torguard.net/checkmytorrentipaddress.php displays my real ip.

   
   

It seems the problem is that you must set up "ProxyUrls" metadata and current implementation fills in only "UseProxy". Looks like KIO ignores proxy setting in this case. Perhaps it's a KIO problem. Didn't dig deeper.

   
   

After setting "ProxyUrls" equal to "UseProxy" avarything seems to get working as expected.

   
   

UPD.: I tend to think that "UseProxy" is ignored if no "ProxyUrls" is set or overwrited with "ProxyUrls" even if "ProxyUrls" is empty. If i'm looking at right code line... At least it works if I comment out md["UseProxy"] = p; and leave only "ProxyUrls".

   
   

   
~  

UPD2: There is one more problem. After I'd fixed http proxy (still not sure if i did this in a corret way). I found out that some torrents can't connect to trackers which they could without proxy. The status was wrong info_hash-something. I've tried some 3rd party http proxy instead of my machine's tor - same result. Then I debug it. And it looks like the urls like

  ~

UPD3: Another KIO problem that was referenced here was solved under https://git.reviewboard.kde.org/r/130040/

-   http://bt4.t-ru.org/ann?peer_id=-KT50DV-KBXFxAWAVRPZ&port=6881&uploaded=0&downloaded=0&left=0&compact=1&numwant=200&key=1041295926&event=started&info_hash=%3F%B3j%14%E6%A4%8D%E7%EC%60%B4%D2%24%CD%B2%21%A46Ga
-   hits the proxy as
-   http://bt4.t-ru.org/ann?peer_id=-KT50DV-KBXFxAWAVRPZ&port=6881&uploaded=0&downloaded=0&left=0&compact=1&numwant=200&key=1041295926&event=started&info_hash=%3F%B3j%14?%E7%EC%60%B4%D2%24?%21%A46Ga.
-   Note ? instead of %CD%B2 at the end. I'm pretty sure that the problem is in kio. Most probably here. At the end of all they convert QUrl to QString with default QUrl::PrettyDecoded which is returned in a "pretty form", with most percent-encoded characters decoded. The exact behavior of PrettyDecoded varies from component to component and may also change from Qt release to Qt release. No idea why Qt decided to decode %B4 %D2 back to locale. Perhaps that's a bug too. Perhaps it's my locale dependant. I'm using Qt 4.7.1. Anyway setting QUrl::FullyEncoded should help. I'm trying to build kio to check this. Anyway, I just want to inform you that HTTP Proxy is still not working properly and won't work till kio is fixed.

Loading...