* Revert "perf: use libsmall in libtransmission, pt 3 (#5653)"
This reverts commit 3b03494580.
* Revert "perf: use small in libtransmission (#5650)"
This reverts commit 559f6f0332.
* refactor: reimplement Buffer using small
* refactor: use SmallBuffer in announcer-udp
* refactor: use SmallBuffer in variant-json
* refactor: use SmallBuffer in variant-benc
* refactor: use SmallBuffer in handshake
* refactor: use SmallBuffer in peer-msgs
* refactor: delete move semantics on stack-based buffers
When Transmission listens on both IPv4 and IPv6 interfaces IPv4 listen address
is always passed to CURL's CURLOPT_INTERFACE. In general it stays unnoticed but
if user has multiple IPv6 addresses configured on his system random (first?)
IPv6 address is used. It happens because passed value to CURLOPT_INTERFACE
is not correct -- IPv6 expected but IPv4 is passed.
* refactor: add fetch options object to tr_webRun()
Fold `tr_webRun()`, `tr_webRunWithCookies()`, and `tr_webRunWebseed()`
into a single API that takes an options argument that callers can
customize to their needs.
Also does a surface cleanup pass to the tr_webseed and tr_web internal
structures, e.g. making fields const where possible, not using raw
pointers, and making some fields private.
This revision is still full of code smells. Refactoring the entire
system is overwhelming, so instead I'm doing it in incremental steps.
* refactor: remove effective-url caching in webseeds
The upcoming CURLSH refactor is a more effective way of doing this and
the current appoach makes tr_web harder to refactor, so remove it.
* refactor: webseed rate limiting
The current code that limits the number of parallel fetches is overly
complicated and is also interwoven into the tr_webseed class. Extract
it into a new private helper class "ConnectionLimiter" with a simpler
public API for tr_webseed to use.
This way all the qualifiers (`const`, `volatile`, `mutable`) are grouped
together, e.g. `T const* const x` vs. `const T* const x`. Also helps reading
types right-to-left, e.g. "constant pointer to constant T" vs. "constant
pointer to T which is constant".
There're places where manual intervention is still required as uncrustify
is not ideal (unfortunately), but at least one may rely on it to do the
right thing most of the time (e.g. when sending in a patch).
The style itself is quite different from what we had before but making it
uniform across all the codebase is the key. I also hope that it'll make the
code more readable (YMMV) and less sensitive to further changes.
1. add the option the code to be used under GPLv2 or GPLv3; previously only GPLv2 was allowed
2. add the "proxy option" as described in GPLv3 so we can add future licenses without having to bulk-edit everything again :)
3. remove the awkward "exception for MIT code in Mac client" clause; it was unnecessary and confusing.