-
Notifications
You must be signed in to change notification settings - Fork 9
try to fix more mirror things #146
base: main
Are you sure you want to change the base?
Conversation
41ad002
to
a5639b9
Compare
test/test_compression.cpp
Outdated
Context ctx; | ||
// TODO file URL handling is doing some weird things | ||
auto target | ||
= DownloadTarget::from_url(ctx, "file:///" + filename.string(), "out_zst.txt", "."); |
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.
Somewhere we need to stop stripping a /
...
@@ -35,8 +35,10 @@ namespace powerloader | |||
class mirror_map_type : private mirror_map_base | |||
{ | |||
public: | |||
using mirror_map_base::begin; |
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.
I initially voluntarilly didnt expose begin/end
because that breaks the garantee that the values of the vector are unique (because then we can access and modify the vectors).
Suggestions: either
- use
as_map()
which makes a copy, not modifying this container; - or expose the const versions of
begin/end
only.
|
||
ctx.mirror_map.create_unique_mirror<Mirror>(host, ctx, mirror_url); | ||
ctx.mirror_map.create_unique_mirror<Mirror>(mirror_url, ctx, mirror_url); |
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.
Just to be sure: the original code in the cli
's main.cpp was using the variable host
as key, which is why it was like that before. It doesnt change much of the meaning here but I'm not sure if it's ok.
{ | ||
dl_target->clear_base_url(); | ||
// TODO proper error handling here! :) |
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.
What error handling is missing?
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.
Not throwing runtime error but something more proper.
enforces that targets must have at least one valid mirror associated …
I've merged most of the changes from this PR in smaller PRs over the weekend. There was a tricky segfault on Windows, but I think it was due to us not forcing |
@Klaim it's dirty and doesn't work but I tried to clean up our mirror issues a bit.