Skip to content

Add support for Rocky Linux 8 / libcurl 7.61 #517

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,15 @@ jobs:
CXX: clang++
libdir: lib

- name: Rocky Linux x64 Clang gnustep-2.2
- name: Rocky Linux 8 x64 Clang gnustep-2.2
container: rockylinux:8
library-combo: ng-gnu-gnu
runtime-version: gnustep-2.2
CC: clang
CXX: clang++
libdir: lib64

- name: Rocky Linux 9 x64 Clang gnustep-2.2
container: rockylinux:9
library-combo: ng-gnu-gnu
runtime-version: gnustep-2.2
Expand Down
3 changes: 0 additions & 3 deletions Headers/GNUstepBase/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,6 @@
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM

/* Define to 1 if you have the `resolv' library (-lresolv). */
#undef HAVE_LIBRESOLV

/* Define to 1 if you have the `rt' library (-lrt). */
#undef HAVE_LIBRT

Expand Down
10 changes: 10 additions & 0 deletions Source/NSURLSessionConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
* Software Foundation, Inc., 31 Milk Street #960789 Boston, MA 02196 USA.
*/

#import "Foundation/NSException.h"
#import "Foundation/NSURLSession.h"
#import "Foundation/NSHTTPCookie.h"

#include <curl/curl.h>

// TODO: This is the old implementation. It requires a rewrite!

@implementation NSURLSessionConfiguration
Expand Down Expand Up @@ -166,7 +169,14 @@ - (NSInteger) HTTPMaximumConnectionLifetime

- (void) setHTTPMaximumConnectionLifetime: (NSInteger)n
{
#if CURL_AT_LEAST_VERSION(7, 66, 0)
_HTTPMaximumConnectionLifetime = n;
#else
[NSException raise: NSInternalInconsistencyException
format: @"-[%@ %@] not supported by the version of Curl"
@" this library was built with",
NSStringFromClass([self class]), NSStringFromSelector(_cmd)];
#endif
}

- (BOOL) HTTPShouldUsePipelining
Expand Down
4 changes: 4 additions & 0 deletions Source/NSURLSessionTask.m
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ @interface _GSMutableInsensitiveDictionary : NSMutableDictionary
case CURLE_COULDNT_RESOLVE_HOST:
urlError = NSURLErrorDNSLookupFailed;
break;
#if CURL_AT_LEAST_VERSION(7, 69, 0)
case CURLE_QUIC_CONNECT_ERROR:
#endif
case CURLE_COULDNT_CONNECT:
urlError = NSURLErrorCannotConnectToHost;
break;
Expand Down Expand Up @@ -1048,10 +1050,12 @@ - (instancetype) initWithSession: (NSURLSession *)session
/* Set to HTTP/3 if requested */
if ([request assumesHTTP3Capable])
{
#if CURL_AT_LEAST_VERSION(7, 66, 0)
curl_easy_setopt(
_easyHandle,
CURLOPT_HTTP_VERSION,
CURL_HTTP_VERSION_3);
#endif
}

/* Configure the custom CA certificate if available */
Expand Down
12 changes: 6 additions & 6 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -14686,9 +14686,9 @@ if eval $CURL_CONFIG --version 2>/dev/null >/dev/null && test "$SKIP_CURL_CONFIG
curl_ver=`$CURL_CONFIG --version | sed -e "s/libcurl //g"`
curl_maj=`echo $curl_ver | sed -e "s/^\(.*\)\.\(.*\)\.\(.*\)$/\1/"`
curl_min=`echo $curl_ver | sed -e "s/^\(.*\)\.\(.*\)\.\(.*\)$/\2/"`
if test $curl_maj -lt 7 -o \( $curl_maj -eq 7 -a $curl_min -lt 66 \); then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FAILED (version too old to use" >&5
printf "%s\n" "FAILED (version too old to use" >&6; }
if test $curl_maj -lt 7 -o \( $curl_maj -eq 7 -a $curl_min -lt 61 \); then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FAILED (version $curl_ver too old to use, need at least 7.61)" >&5
printf "%s\n" "FAILED (version $curl_ver too old to use, need at least 7.61)" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ... version $curl_ver" >&5
printf "%s\n" "yes ... version $curl_ver" >&6; }
Expand Down Expand Up @@ -14718,7 +14718,7 @@ else
if pkg-config --exists libcurl; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes ... via pkg-config" >&5
printf "%s\n" "yes ... via pkg-config" >&6; }
if $PKG_CONFIG --atleast-version 2.66.0 libcurl; then
if $PKG_CONFIG --atleast-version 7.61.0 libcurl; then
for ac_header in curl/curl.h
do :
ac_fn_c_check_header_compile "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default"
Expand All @@ -14740,8 +14740,8 @@ done
curl_all=yes
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FAILED (version too old to use" >&5
printf "%s\n" "FAILED (version too old to use" >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: FAILED (version too old to use, need at least 7.61)" >&5
printf "%s\n" "FAILED (version too old to use, need at least 7.61)" >&6; }
curl_all=no
fi
else
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -3757,8 +3757,8 @@ if eval $CURL_CONFIG --version 2>/dev/null >/dev/null && test "$SKIP_CURL_CONFIG
curl_ver=`$CURL_CONFIG --version | sed -e "s/libcurl //g"`
curl_maj=`echo $curl_ver | sed -e "s/^\(.*\)\.\(.*\)\.\(.*\)$/\1/"`
curl_min=`echo $curl_ver | sed -e "s/^\(.*\)\.\(.*\)\.\(.*\)$/\2/"`
if test $curl_maj -lt 7 -o \( $curl_maj -eq 7 -a $curl_min -lt 66 \); then
AC_MSG_RESULT([FAILED (version too old to use])
if test $curl_maj -lt 7 -o \( $curl_maj -eq 7 -a $curl_min -lt 61 \); then
AC_MSG_RESULT([FAILED (version $curl_ver too old to use, need at least 7.61)])
else
AC_MSG_RESULT(yes ... version $curl_ver)
AC_CHECK_HEADERS(curl/curl.h, curl_ok=yes, curl_ok=no)
Expand All @@ -3775,7 +3775,7 @@ else
if test -n "$PKG_CONFIG"; then
if pkg-config --exists libcurl; then
AC_MSG_RESULT(yes ... via pkg-config)
if $PKG_CONFIG --atleast-version 2.66.0 libcurl; then
if $PKG_CONFIG --atleast-version 7.61.0 libcurl; then
AC_CHECK_HEADERS(curl/curl.h, curl_ok=yes, curl_ok=no)
if test "$curl_ok" = yes; then
HAVE_LIBCURL=1
Expand All @@ -3786,7 +3786,7 @@ else
curl_all=yes
fi
else
AC_MSG_RESULT([FAILED (version too old to use])
AC_MSG_RESULT([FAILED (version too old to use, need at least 7.61)])
curl_all=no
fi
else
Expand Down
Loading