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

set curl options in libnetcdf via NC_rcfile_insert #174

Merged
merged 3 commits into from
May 25, 2022

Conversation

visr
Copy link
Contributor

@visr visr commented May 5, 2022

Not working yet, but hopefully we can get there to fix #173.

I searched the netcdf-c repository and found ocset_curlopt, which seems to do just what we need.

However it needs a OCstate object. If I'm reading things right this can be created using ocopen. That function does need a url argument, and I don't know what that should be. I put in an empty string for now.

When I run this, it crashes on calling ocopen, with

drc.c:80: ncrc_setrchome: Assertion `ncrc_globalstate && ncrc_globalstate->home' failed.

I don't understand this error though. This is the code:
https://github.com/Unidata/netcdf-c/blob/main/libdispatch/drc.c#L112-L123

But I don't see where home would be set here.
https://github.com/Unidata/netcdf-c/blob/c147bdd7b6032192b1738c6445e9ed370e14db5c/libsrc4/nc4internal.c#L2098-L2123

Ah and these seem like relevant environment variables:

/* getenv() keys */
#define NCRCENVIGNORE "NCRCENV_IGNORE"
#define NCRCENVRC "NCRCENV_RC"
#define NCRCENVHOME "NCRCENV_HOME"

This is where I got stuck, not sure how to proceed, or if I'm going about this right.

@Alexander-Barth Alexander-Barth changed the title try to set curl options in libnetcdf set curl options in libnetcdf via NC_rcfile_insert May 25, 2022
@Alexander-Barth
Copy link
Owner

Thanks a lot for your help! I am merged this as we have NetCDF_jll v400.802.103+0 with the required patch now.

@Alexander-Barth Alexander-Barth merged commit d93d80f into Alexander-Barth:master May 25, 2022
@visr
Copy link
Contributor Author

visr commented May 25, 2022

Oh that's great! Before releasing, it would be good to remove the println, and the NC_rclookup from __init__, as well as those comment lines.

@visr visr deleted the ca branch May 25, 2022 12:23
@Alexander-Barth
Copy link
Owner

Yes, sure! Already done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

julia 1.8 beta3, NetCDF_jll v400.802.102+0: Failure to load OPENDAP URL with TLS
2 participants