Use CURLOPT_PROTOCOLS_STR where available - #50
Merged
Conversation
CURLOPT_PROTOCOLS has been deprecated since libcurl 7.85.0, so building against a recent libcurl warns. Switch to CURLOPT_PROTOCOLS_STR, keeping the old call behind a version check so older libcurl still builds. The allowed set is unchanged: http, https and file.
Owner
|
Thanks! The tests have been broken for a while now, because libxml2 now assumes a different character encoding when the html header is missing. I should get around to fixing them at some point. |
Contributor
Author
|
Glad to help, and thanks for merging it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #38.
CURLOPT_PROTOCOLSis deprecated since libcurl 7.85.0, so building against a recent libcurl warns. This switches toCURLOPT_PROTOCOLS_STRbehind aCURL_AT_LEAST_VERSION(7, 85, 0)check, so older libcurl keeps the old call. That was the blocker you mentioned in the issue, where your distro did not have the new option yet.The allowed set is unchanged: http, https and file.
Checked on libcurl 8.21.0:
CURLOPT_PROTOCOLSdeprecation disappearing, and nothing new shows up#if 0still compiles, with no unused variable warning, so the guard aroundlong protocolsis needed and correcthttps://andfile://still fetch and extract, andftp://is still refused withProtocol "ftp" is disabledtests/checkdoes not pass in my environment, but it fails byte for byte identically with and without this patch, so it is unrelated to the change. rdrview writes no dump output when it has no controlling terminal here, which is what the test compares.