-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Add verbose, keepalive, keepidle, keepintvl to c-libcurl #21613
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
Conversation
|
I've fixed also the manual tests. They were a little bit outdated. |
|
please update the samples when you've time |
|
Yep, updated and fixed. Sorry |
|
I have another proposal, just open for discussion: what about exposing directly the It will look like this: and on do you think it is a bad idea? |
sounds good to me. i think some other clients (e.g. java, typescript) are already offering something similar to cater different use cases (fine tuning the request before sending it out). |
|
thanks for the PR, which has been merged have a good week ahead |
…s#21613) * Add keepalive to c-libcurl * Fix manual tests on client/petstore/c * Update Readme of c/libcurl * better curlConfig handling on c-libcurl
Hello,
I've added the keepalive functionality to c-libcurl.
It's implemented like in this example: https://curl.se/libcurl/c/CURLOPT_TCP_KEEPALIVE.html
This feature is available since libcurl 7.25.0.
I didn't implement CURLOPT_TCP_KEEPCNT because it was added only in libcurl 8.9.0
I took this opportunity to move also the
verboseoption in the new sslConfig_t struct accessible in the apiClient. In this way it can be programmatically activated (it's very useful instead of recompiling).Technical Note: This configuration is meaninful with
watchtype of calls, but activating it to normal calls doesn't have any side effects.About testing:
I regenerated the samples but apparently they are outdated (the c ones) and need to be fixed. I will try to fix them in a separate PR.
I've tested this code by modifying the generated code in the kubernetes-c library, as you can see here: https://github.com/kubernetes-client/c/pull/275/files
C Committee: @zhemant (2018/11) @ityuhui (2019/12) @michelealbano (2020/03) @eafer (2024/12)
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master(upcoming7.x.0minor release - breaking changes with fallbacks),8.0.x(breaking changes without fallbacks)