-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Description
https://curl.haxx.se/mail/lib-2019-03/0098.html
I did this
I'm writing a C application (rsyslog) which uses libcurl and I would like to be able to pass in a lot of parameters to libcurl without having to implement support for every single option to
pass in separately to curl_easy_setopt()
. That's a lot of boilerplate code to have to write/debug/maintain, and that code has to be duplicated in every application that uses libcurl.
I expected the following
The curl cli has a -K option which you can use to pass in a config file, but it doesn't look as though this is part of the public API, and there is no option like CURLOPT_CONFIG_FILE
for curl_easy_setopt()
. Perhaps most of the code from src/tool_getparam.c and src/tool_operate.c and corresponding headers could be moved into libcurl and the public API. Bonus points for allowing all of the options that can be set in curlrc to also be set via environment variables (which is very nice for containerized/Kubernetes applications).
curl/libcurl version
curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.36 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets
operating system
Linux localhost 4.18.0-80.el8.x86_64 #1 SMP Wed Mar 13 12:02:46 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux