Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Sean,
I have discovered another problem under windows. HTTPS calls did not work. I had not tested this :(
Now I have set the CURLOPT_SSL_OPTIONS to CURLSSLOPT_NATIVE_CA for this.
Maybe you can test if this has an effect in a Linux environment? Actually this option should only matter for Windows,
if I understood the documentation correctly.
That is one option, the other option would be to set the CURLOPT_CAINFO option and to set the path to the curl-ca-bundle.crt file.
First I also copied this curl-ca-bundle.crt to the JANET_BINPATH and set the options to this path. But this would be more cumbersome, because I would have to do a special handling for Windows again.
Unfortunately I discovered another serious problem under windows. It has nothing to do with SSL. Unfortunately I haven't found a solution yet.
The problem is, when I call the c_send_request function for the second time, the program crashes on the second call of curl_global_cleanup();
If I comment out this function call, the c_send_request this function runs as expected.
But that can't be the right way :( Unfortunately I don't have a solution for it yet.
The documentation for libcurl has the following note:
"curl_global_cleanup does not block waiting for any libcurl-created threads to terminate (such as threads used for name resolving). If a module containing libcurl is dynamically unloaded while libcurl-created threads are still running then your program may crash or other corruption may occur. We recommend you do not run libcurl from any module that may be unloaded dynamically. This behavior may be addressed in the future. "
I think somehow here is the problem?
Edit:
Here is also another ticket about a similar problem? Maybe the same?
curl/curl#997 (comment)
Maybe don't merge this pull request after all.
I will try a reproduce the problem in the next days, without a dependency to Janet.
Maybe the problem has nothing to do with Janet itself.
I think I also need to understand the Microsoft compiler and linker a bit better.
libcurl can somehow be linked statically or danamically (libcurl.a (for static linking) and libcurldll.a (for dynamic linking)).
Sorry, I thought it would be easier.
Greetings
Jan-Felix