-
Notifications
You must be signed in to change notification settings - Fork 56
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
NAM: Implement direct media requests fallback #576
base: dev
Are you sure you want to change the base?
Conversation
Kudos, SonarCloud Quality Gate passed! |
Upon some more testing - this really needs a cache/registry of homeservers, otherwise each direct request becomes a sequence of three (not two, as would be optimal): .well-known resolution, requesting login flows (there's no way in |
74d9446
to
2d10238
Compare
This is behind a configuration switch because direct unauthenticated requests are at odds with the Matrix model where clients stick to their homeservers and only homeservers talk to each other. The implementation is also quite inefficient atm, causing a .well-known resolution roundtrip every single time a direct media request is made.
2d10238
to
0eafc1d
Compare
Also: simplify the expression in FINISH_TEST.
Going through QSettings doesn't work quite well on Windows; setting it in Quotest and immediately testing through another QSettings instance inside NetworkAccessManager (in another thread) returns the previous value. In fact, there's no general guarantee for that, as almost all QSettings member functions are reentrant but not thread-safe. The flag is only initialised from QSettings once at the first NAM creation, and its changes are only propagated to QSettings but never read again. Implication: changes in QSettings files when the client is running will only be reflected at the next run (or may be overwritten altogether), so just don't change settings files while the client is running, ok?
0eafc1d
to
e337379
Compare
std::atomic_flag(bool) is not a standard constructor, and MSVC doesn't have it, for one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable, i guess
(From the commit message:)
This is behind a configuration switch because direct unauthenticated requests are at odds with the Matrix model where clients stick to their homeservers and only homeservers talk to each other. The implementation is also quite inefficient atm, causing a .well-known resolution roundtrip every single time a direct media request is made.