-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
sectransp: add support for HTTP/2 in gcc builds #16581
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
Closed
Closed
Conversation
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
This breaks building curl on macOS versions before High Sierra, because it ends up in the new
|
@EricFromCanada Does this patch fix it for you? diff --git a/lib/vtls/sectransp.c b/lib/vtls/sectransp.c
index f0094df584..3e491adf37 100644
--- a/lib/vtls/sectransp.c
+++ b/lib/vtls/sectransp.c
@@ -1092,8 +1092,8 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
return result;
if(connssl->alpn) {
-#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \
- defined(HAVE_BUILTIN_AVAILABLE)
+#if CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11
+#ifdef HAVE_BUILTIN_AVAILABLE
if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) {
#else
if(&SSLSetALPNProtocols && &SSLCopyALPNProtocols) {
@@ -1119,6 +1119,7 @@ static CURLcode sectransp_connect_step1(struct Curl_cfilter *cf,
Curl_alpn_to_proto_str(&proto, connssl->alpn);
infof(data, VTLS_INFOF_ALPN_OFFER_1STR, proto.data);
}
+#endif /* CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 */
}
if(ssl_config->key) {
@@ -2092,8 +2093,8 @@ check_handshake:
}
if(connssl->alpn) {
-#if (CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11) && \
- defined(HAVE_BUILTIN_AVAILABLE)
+#if CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11
+#ifdef HAVE_BUILTIN_AVAILABLE
if(__builtin_available(macOS 10.13.4, iOS 11, tvOS 11, *)) {
#else
if(&SSLSetALPNProtocols && &SSLCopyALPNProtocols) {
@@ -2124,6 +2125,7 @@ check_handshake:
if(alpnArr)
CFRelease(alpnArr);
}
+#endif /* CURL_BUILD_MAC_10_13 || CURL_BUILD_IOS_11 */
}
return CURLE_OK; |
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Apr 25, 2025
Reported-by: Eric Knibbe Bug: curl#16581 (comment) Regression from 2d94439 curl#16581
@vszakats Yes it does; tested on 10.11 and 10.12 via Homebrew. |
Thanks Eric! Planning to merge this soon via #17193. |
vszakats
added a commit
that referenced
this pull request
Apr 25, 2025
Reported-by: Eric Knibbe Bug: #16581 (comment) Regression from 2d94439 #16581 Closes #17193
nbaws
pushed a commit
to nbaws/curl
that referenced
this pull request
Apr 26, 2025
Reported-by: Eric Knibbe Bug: curl#16581 (comment) Regression from 2d94439 curl#16581 Closes curl#17193
pps83
pushed a commit
to pps83/curl
that referenced
this pull request
Apr 26, 2025
Before this patch `--http2` did not work in gcc builds with Secure Transport, because ALPN relied on a compiler supporting the `HAVE_BUILTIN_AVAILABLE` aka `__builtin_available()` feature. This is clang-specific and missing from gcc (as of gcc v14). Add support for ALPN and HTTP/2 when this compiler feature is missing. Also drop test exceptions from GHA/macos in CI. Follow-up to 092f681 Ref: c349bd6 curl#14097 (issue 15.) Ref: curl#4314 Closes curl#16581
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.
Before this patch
--http2
did not work in gcc builds with SecureTransport, because ALPN relied on a compiler supporting the
HAVE_BUILTIN_AVAILABLE
aka__builtin_available()
feature. Thisis clang-specific and missing from gcc (as of gcc v14).
Add support for ALPN and HTTP/2 when this compiler feature is missing.
Also drop test exceptions from GHA/macos in CI.
Follow-up to 092f681
Ref: c349bd6 #14097 (issue 15.)
Ref: #4314
CURL_HTTP_VERSION*
enums to long constants #16580 to fix tests 2402, 2404https://github.com/curl/curl/actions/runs/13687990672/job/38275638630?pr=16581