-
Notifications
You must be signed in to change notification settings - Fork 363
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
Wrap more libcurl calls #2421
Wrap more libcurl calls #2421
Conversation
libmamba/src/core/fetch.cpp
Outdated
@@ -159,12 +95,12 @@ namespace mamba | |||
{ | |||
auto& ctx = Context::instance(); | |||
|
|||
if (!ctx.curl_initialized) | |||
if (!m_curl_initialized) |
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 think there is a risk that we do many times the same thing here since ctx.curl_initialized
is a global, shared variable, while m_curl_initialized
is a data member specific to a DownloadTarget data member.
This might not be a big deal here since we just set another variable in the context, but it might become later if we add stuff in this function.
What is the motivation for removing this variable from the context? Would it make sense to have it as part of a "DownloaderOption" subobject in the Context? (that could be done in another PR, but the current variable would remain in the context in this PR).
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.
Well I actually found out that it's not used anywhere but here in the fetch
... so no reason to keep it in the context! Do you see any, or think it would be used somewhere else?
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 think it should live with the ssl_verify
variable and maybe move to CURLSetup
or any configuration class for curl on the long run. This should be set once and for good. Keeping it in the context is ok for now.
Part of #2356
This PR includes:
curl_initialized
from context toDownloadTarget
class memberhide_secrets
function fromurl.{hpp, cpp}
toutil.{hpp, cpp}
m_errorbuffer
set_curl_handle
for more curl calls wrapping