Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing latest version of BEP-7 for HTTP requests #1661

Merged
merged 11 commits into from Jun 18, 2022

Conversation

lvella
Copy link
Contributor

@lvella lvella commented Apr 2, 2021

Implements the latest version of BEP-7 on HTTP announces, which solves issue #1659. DNS cache in libcurl had to be disabled in order to force an IPv4 or IPv6 connection, otherwise it simply uses the cached address, irrespective of the protocol. A fix to the libcurl issue has been merged to master, so disabling the cache is not done for newer versions libcurl.

Fixes #1659.

@lvella lvella changed the title Implementing latest version of BEP-7 (solves issue #1659) Implementing latest version of BEP-7 Apr 2, 2021
@lvella lvella force-pushed the BEP-7 branch 4 times, most recently from 555f1e7 to 35e2913 Compare April 10, 2021 14:28
@lvella lvella marked this pull request as draft May 24, 2021 13:08
@lvella lvella marked this pull request as ready for review July 17, 2021 11:47
@lvella lvella marked this pull request as draft July 17, 2021 13:53
@lvella lvella force-pushed the BEP-7 branch 2 times, most recently from 0712a9e to 776827d Compare July 17, 2021 16:35
@lvella lvella marked this pull request as ready for review July 17, 2021 17:04
@lvella
Copy link
Contributor Author

lvella commented Jul 17, 2021

Seems to be working, but I did not find an UDP tracker implementing BEP-7.

@ckerr ckerr added enhancement needs update The PR has needs to be updated by the submitter scope:core labels Jan 20, 2022
@Anuskuss Anuskuss mentioned this pull request Feb 20, 2022
@Anuskuss
Copy link

Rebase?

@ckerr
Copy link
Member

ckerr commented Feb 25, 2022

@lvella would you be interested in updating this patch? If so, I'd be happy to review / test

@lvella
Copy link
Contributor Author

lvella commented Feb 26, 2022 via email

@lvella lvella closed this Feb 26, 2022
@lvella lvella reopened this Feb 26, 2022
@ckerr
Copy link
Member

ckerr commented Feb 27, 2022

@Ivella I will be traveling this week, so there may be some lag in code review. Don't worry, this PR hasn't been forgotten again

@lvella
Copy link
Contributor Author

lvella commented Mar 9, 2022

Hi @ckerr , I have ported one of the two patches in this PR (the one affecting http announces) to main:
https://github.com/lvella/transmission/tree/BEP-7-http

I still have to port the patch for udp announces, but that one is purely theoretical, as I never encountered an udp tracker that serves both via IPv4 and IPv6, so I couldn't even test it.

Do you think I should include just the http patch in this PR, and leave the upd patch for another PR?

@lvella
Copy link
Contributor Author

lvella commented Mar 9, 2022

BTW, do we have the public IPv4 address through which we are reachable? It would be nice to add &ipv4=x.x.x.x to requests via IPv6, to enable IPv6-only trackers to know the IPv4 address of the peer (also, purely theoretical issue).

@ckerr
Copy link
Member

ckerr commented Mar 13, 2022

BTW, do we have the public IPv4 address through which we are reachable? It would be nice to add &ipv4=x.x.x.x to requests via IPv6, to enable IPv6-only trackers to know the IPv4 address of the peer (also, purely theoreti

Check tr_session.externalIP(), which is set iff we get our public IP back from a tracker response.

Do you think I should include just the http patch in this PR, and leave the upd patch for another PR?

Split it into two, please.

@lvella lvella changed the title Implementing latest version of BEP-7 Implementing latest version of BEP-7 for HTTP requests Mar 15, 2022
@lvella
Copy link
Contributor Author

lvella commented Mar 16, 2022

What do you think of this solution for Curl's version problem?

@GaryElshaw

This comment was marked as duplicate.

@Coeur

This comment was marked as resolved.

@lvella
Copy link
Contributor Author

lvella commented May 1, 2022

@lvella "This branch has conflicts that must be resolved"

What about the concerns raised by @ckerr ? Is the solution provided for the curl version problem acceptable (i.e. single request with both &ipv6 and &ipv4 set)?

@Coeur
Copy link
Collaborator

Coeur commented May 1, 2022

What about the concerns raised by @ckerr ?

I don't have a "best" answer. But if people are unhappy regarding the number DNS requests, and others don't care, then eventually provide a settings to offer the choice of behaviour to the enduser.

@lvella
Copy link
Contributor Author

lvella commented May 2, 2022

@Coeur It is now compatible with main, but these issues pointed by the checks were already there.

@Wanderboot
Copy link

Is there any hope of this actually getting accepted? I miss being able to seed.

@GaryElshaw

This comment was marked as duplicate.

@lvella
Copy link
Contributor Author

lvella commented Jun 15, 2022

I don't know. I lost count on how many times I have fixed the conflicts with main. I would like a comment from someone with merge permission before I do it again.

@lvella
Copy link
Contributor Author

lvella commented Jun 15, 2022

BTW, should it be me to click "Resolve conversation" on the issues?

@ckerr
Copy link
Member

ckerr commented Jun 15, 2022

I've mostly left this alone because a previous revision made the "excessive DNS requests" issue worse and TBH I missed the commit that addressed the dns requests. I'm OK with this landing after the curl_version_info() question is resolved

@lvella
Copy link
Contributor Author

lvella commented Jun 16, 2022

@ckerr I have updated again with main. What curl_version_info() question are you talking about? If it is about the check for curl version, it is like this:

#if LIBCURL_VERSION_NUM < CURL_VERSION_BITS(7, 77, 0)

see L431.

@ckerr
Copy link
Member

ckerr commented Jun 17, 2022

@ckerr I have updated again with main. What curl_version_info() question are you talking about? If it is about the check for curl version, it is like this:

#if LIBCURL_VERSION_NUM < CURL_VERSION_BITS(7, 77, 0)

see L431.

Hi @lvella, my point is that #if LIBCURL_VERSION_BITS(7, 77, 0) is going to be evaluated at compile time, meaning it'll pick up the value of whatever version of libcurl happens to be installed on the build machine rather than whatever's on the user's machine when they install and run Transmission. Since we want to know what's running on the user's machine, we need to make a runtime test instead, i.e. curl_version_info()

libtransmission/announcer-http.cc Outdated Show resolved Hide resolved
libtransmission/announcer-http.cc Outdated Show resolved Hide resolved
@ckerr
Copy link
Member

ckerr commented Jun 17, 2022

@ckerr I have updated again with main. What curl_version_info() question are you talking about?

d'oh my apologies. As I went in to add the if (curl_version_info(...) suggestion above, I saw I still had a review comment from yesterday that was still pending. So my comment about curl_version_info() must've looked like it came out of nowhere because I hadn't submitted my review yesterday. 😅

ckerr
ckerr previously approved these changes Jun 18, 2022
@lvella
Copy link
Contributor Author

lvella commented Jun 18, 2022

@ckerr Wait! NOOOOO! The curl_version_info is not there yet! It is one commit away!

@ckerr ckerr dismissed their stale review June 18, 2022 00:16

by request from @Ivella

@lvella
Copy link
Contributor Author

lvella commented Jun 18, 2022

@ckerr Done!

@ckerr ckerr merged commit 42198af into transmission:main Jun 18, 2022
@Anuskuss
Copy link

@ckerr New stable please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs update The PR has needs to be updated by the submitter scope:core
Development

Successfully merging this pull request may close these issues.

IPv6+IPv4 support is not good.
6 participants