diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-10-01 20:54:53 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-10-01 20:54:53 +0100 |
commit | 391b5b359a346aff490103da7dddc85047f83830 (patch) | |
tree | 29eea460a0bd7e1ff21d43b9d6df9af4d8a175e1 /dev-php/pecl-http | |
parent | c719fdcee603a5a706a45d10cb598762d56a727d (diff) |
gentoo resync : 01.10.2021
Diffstat (limited to 'dev-php/pecl-http')
-rw-r--r-- | dev-php/pecl-http/Manifest | 2 | ||||
-rw-r--r-- | dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch | 243 |
2 files changed, 238 insertions, 7 deletions
diff --git a/dev-php/pecl-http/Manifest b/dev-php/pecl-http/Manifest index 5d858307a2b6..be99011fd3da 100644 --- a/dev-php/pecl-http/Manifest +++ b/dev-php/pecl-http/Manifest @@ -1,4 +1,4 @@ -AUX pecl-http-3.2.4-curl-cookies.patch 502 BLAKE2B b2ac97150edc35e649bcf5674be59401753413bef6d920beee1f50b3a9f9519545fc3ceb5ed030ce28acf4469ab69323a96bc07cdc7a3993b0033f039964d9ca SHA512 19c24fe2701ec6bf360a9e780a3573ea5ce2aad519412d66c18b9c331083c50e4dbbc453d04e931c7df0b9016a4407f316646ab00537a538bb5fdc9d84a97e54 +AUX pecl-http-3.2.4-curl-cookies.patch 7806 BLAKE2B 96bd439d3ccb16bc7a67e062dfe9ad66bdcd193553764e087dd938e3f76c05796bb09571d934658a8b5d6c22bf2db03c213731ab2f35d03a20902c24897625c6 SHA512 cbbb215f3f0c5527f318283db4984a63b830727727081834f3a3383576d581359cfc7865e35a3b0b6ea4693c7c91ff93570c3c8964a8cd7e5d593095b16f0d4a DIST pecl_http-3.2.1.tgz 221244 BLAKE2B b6581829fb8a800e24ccedd4d0f3efbaf558850bdc356d27a6e1d1097a8e2cfc61963a1daccd1d0f269a7cef5b243d45cdfaff5138321fe20df615dde44d19e3 SHA512 e67d4b32ba6f524e3fcf65f5497b94275e1a4a14fce97c57afe366369f368b3acdbedf364ed73cf983fb2c5f57f498adaa1100e7c936f11cbc5de1caedad7b51 DIST pecl_http-3.2.4.tgz 220631 BLAKE2B 996236cf9dd2f7d9bfaf046306e99c3ccf778261df19df8fd828b5811798f784841d89a6890e7347bd20cc6da71c966ea3ac9b17bf058e0bb766db7e1a8a6c49 SHA512 59c41d57c94a6e50e2f0b261130a24791b2845246f783b55e7f644f9a897d3650da364c5b38a860761b4a23f9266ed05000d6348bae2a7941e59d6bf5fb61a9e DIST pecl_http-4.2.1.tgz 224452 BLAKE2B 58d2e1159aa64b9893b2b8b67c8444801308084ac13a743760c25cb3d0456fb586f69dc6b9e77db53341e4e9e45ce68f954c47b4e2663afe86de67d63db5e8e2 SHA512 2ad7e57fae313a7b46ba88e528e124ac9d83804827131a6ef478ccf3cf5883dec2d928b8ceb377ee7f5947c76f24d640d77533a9946612419e526786a79877e6 diff --git a/dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch b/dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch index 3c124b4624a6..2f3a7c73a240 100644 --- a/dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch +++ b/dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch @@ -1,11 +1,242 @@ ---- a/src/php_http_client_curl.c 2021-01-13 10:34:34.000000000 -0500 -+++ b/src/php_http_client_curl.c 2021-09-22 10:38:58.854615743 -0400 -@@ -834,7 +834,7 @@ +diff --git a/autoconf/pecl/libbrotli.m4 b/autoconf/pecl/libbrotli.m4 +index f8916e2..575f635 100644 +--- a/autoconf/pecl/libbrotli.m4 ++++ b/autoconf/pecl/libbrotli.m4 +@@ -1,5 +1,11 @@ + + AC_DEFUN([PECL_CHECK_LIBBROTLI], [ ++ dnl config.m4 calls PECL_CHECK_DONE once more ++ PECL_COUNT_CHECKS([+1]) ++ PECL_SAVE_ENV([CPPFLAGS], [libbrotli]) ++ PECL_SAVE_ENV([LDFLAGS], [libbrotli]) ++ PECL_SAVE_ENV([LIBS], [libbrotli]) ++ + PECL_CHECK_LIBBROTLI_COMMON([$1], [$2]) + PECL_CHECK_DONE(libbrotlicommon, [$PECL_VAR([HAVE_LIBBROTLI_COMMON])]) + PECL_CHECK_LIBBROTLI_DEC([$1], [$2]) +diff --git a/autoconf/pecl/libcurl.m4 b/autoconf/pecl/libcurl.m4 +index 4d99207..8de9499 100644 +--- a/autoconf/pecl/libcurl.m4 ++++ b/autoconf/pecl/libcurl.m4 +@@ -160,6 +160,26 @@ AC_DEFUN([PECL_HAVE_LIBCURL_SSL], [dnl + fi + fi + ]) ++ ++ PECL_HAVE_CONST([curl/curl.h], [CURL_LOCK_DATA_SSL_SESSION], int, [ ++ AC_CACHE_CHECK([whether curl_share accepts CURL_LOCK_DATA_SSL_SESSION], PECL_CACHE_VAR([LIBCURL_SHARE_SSL]), [ ++ PECL_CACHE_VAR([LIBCURL_SHARE_SSL])= ++ AC_TRY_RUN([ ++ #include <curl/curl.h> ++ int main(int argc, char *argv[]) { ++ CURLSH *ch = curl_share_init(); ++ return curl_share_setopt(ch, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION); ++ } ++ ], [ ++ PECL_CACHE_VAR([LIBCURL_SHARE_SSL])=yes ++ ], [ ++ PECL_CACHE_VAR([LIBCURL_SHARE_SSL])=no ++ ]) ++ ]) ++ if test "$PECL_CACHE_VAR([LIBCURL_SHARE_SSL])" = yes; then ++ PECL_DEFINE([HAVE_LIBCURL_SHARE_SSL], [1]) ++ fi ++ ]) + ]) + ]) + dnl +diff --git a/autoconf/pecl/pecl.m4 b/autoconf/pecl/pecl.m4 +index ffa45ac..d8735b0 100644 +--- a/autoconf/pecl/pecl.m4 ++++ b/autoconf/pecl/pecl.m4 +@@ -70,6 +70,12 @@ AC_DEFUN([PECL_RESTORE_ENV], [ + $1=$PECL_SAVE_VAR([$2_$1]) + ]) + dnl ++dnl PECL_COUNT_CHECKS(incdec) ++dnl ++AC_DEFUN([PECL_COUNT_CHECKS], [ ++ PECL_VAR([_checks])=$(($PECL_VAR([_checks])$1)) ++]) ++dnl + dnl PECL_EVAL_LIBLINE(libline) + dnl + AC_DEFUN([PECL_EVAL_LIBLINE], [ +@@ -244,6 +250,7 @@ dnl + dnl PECL_CHECK_CUSTOM(name, path, header, lib, version) + dnl + AC_DEFUN([PECL_CHECK_CUSTOM], [ ++ PECL_COUNT_CHECKS([+1]) + PECL_SAVE_ENV([CPPFLAGS], [$1]) + PECL_SAVE_ENV([LDFLAGS], [$1]) + PECL_SAVE_ENV([LIBS], [$1]) +@@ -260,10 +267,10 @@ AC_DEFUN([PECL_CHECK_CUSTOM], [ + done + ]) + if test -n "$PECL_CACHE_VAR([$1_prefix])"; then +- CPPFLAGS="-I$PECL_CACHE_VAR([$1_prefix])/include" +- LDFLAGS="-L$PECL_CACHE_VAR([$1_prefix])/$PHP_LIBDIR" +- LIBS="-l$4" +- PECL_EVAL_LIBLINE([$LDFLAGS $LIBS]) ++ CPPFLAGS="$CPPFLAGS -I$PECL_CACHE_VAR([$1_prefix])/include" ++ LDFLAGS="$LDFLAGS -L$PECL_CACHE_VAR([$1_prefix])/$PHP_LIBDIR" ++ LIBS="$LIBS -l$4" ++ dnl PECL_EVAL_LIBLINE([$LDFLAGS $LIBS]) + + AC_CACHE_VAL(PECL_CACHE_VAR([$1_version]), [ + pushd $PECL_CACHE_VAR([$1_prefix]) >/dev/null +@@ -288,11 +295,11 @@ dnl + dnl PECL_CHECK_CONFIG(name, prog-config, version-flag, cppflags-flag, ldflags-flag, libs-flag) + dnl + AC_DEFUN([PECL_CHECK_CONFIG], [ ++ PECL_COUNT_CHECKS([+1]) + PECL_SAVE_ENV([CPPFLAGS], [$1]) + PECL_SAVE_ENV([LDFLAGS], [$1]) + PECL_SAVE_ENV([LIBS], [$1]) + +- + AC_MSG_CHECKING([for $1]) + ifelse($2, [$PKG_CONFIG $1], [ + AC_CACHE_VAL(PECL_CACHE_VAR([$1_exists]), [ +@@ -311,20 +318,22 @@ AC_DEFUN([PECL_CHECK_CONFIG], [ + AC_CACHE_VAL(PECL_CACHE_VAR([$1_cppflags]), [ + PECL_CACHE_VAR([$1_cppflags])=$($2 $4) + ]) +- CPPFLAGS=$PECL_CACHE_VAR([$1_cppflags]) ++ CPPFLAGS="$CPPFLAGS $PECL_CACHE_VAR([$1_cppflags])" + AC_CACHE_VAL(PECL_CACHE_VAR([$1_ldflags]), [ + PECL_CACHE_VAR([$1_ldflags])=$($2 $5) + ]) +- LDFLAGS=$PECL_CACHE_VAR([$1_ldflags]) ++ LDFLAGS="$LDFLAGS $PECL_CACHE_VAR([$1_ldflags])" + AC_CACHE_VAL(PECL_CACHE_VAR([$1_libs]), [ + PECL_CACHE_VAR([$1_libs])=$($2 $6) + ]) +- LIBS=$PECL_CACHE_VAR([$1_libs]) +- PECL_EVAL_LIBLINE([$LDFLAGS $LIBS]) ++ LIBS="$LIBS $PECL_CACHE_VAR([$1_libs])" ++ dnl PECL_EVAL_LIBLINE([$LDFLAGS $LIBS]) + ifelse($2, [$PKG_CONFIG $1], [ + fi + ]) + ++ AC_MSG_RESULT([${PECL_CHECKED_VERSION([$1]):-no}]) ++ + if test -n "$PECL_CHECKED_VERSION([$1])"; then + PECL_VAR([HAVE_$1])=true + PECL_DEFINE([HAVE_$1]) +@@ -332,8 +341,6 @@ AC_DEFUN([PECL_CHECK_CONFIG], [ + else + PECL_VAR([HAVE_$1])=false + fi +- +- AC_MSG_RESULT([${PECL_CHECKED_VERSION([$1]):-no}]) + ]) + dnl + dnl PECL_CHECK_PKGCONFIG(pkg[, additional-pkg-config-path]) +@@ -355,9 +362,25 @@ dnl + dnl PECL_CHECK_DONE(name, success[, incline, libline]) + dnl + AC_DEFUN([PECL_CHECK_DONE], [ +- if $2; then +- incline=$CPPFLAGS +- libline="$LDFLAGS $LIBS" ++ PECL_COUNT_CHECKS([-1]) ++ success=$2 ++ if $success && test -n "$LDFLAGS$LIBS"; then ++ AC_MSG_CHECKING([whether $1 can be linked]) ++ AC_TRY_LINK([], [], [success=yes], [success=no]) ++ AC_MSG_RESULT([$success]) ++ if ! $success; then ++ AC_MSG_WARN([$1 was found, but fails to link with:]) ++ AC_MSG_WARN([ LDFLAGS='$LDFLAGS']) ++ AC_MSG_WARN([ LIBS='$LIBS']) ++ AC_MSG_WARN([Missing or updated library paths?]) ++ fi ++ fi ++ if $success; then ++ _cppflags=$PECL_SAVE_VAR([$1_CPPFLAGS]) ++ _ldflags=$PECL_SAVE_VAR([$1_LDFLAGS]) ++ _libs=$PECL_SAVE_VAR([$1_LIBS]) ++ incline=${CPPFLAGS:${#_cppflags}} ++ libline=["${LDFLAGS:${#_ldflags}} ${LIBS:${#_libs}}"] + PECL_DEFINE([HAVE_$1]) + else + incline=$3 +diff --git a/config9.m4 b/config9.m4 +index ef7d33e..695701b 100644 +--- a/config9.m4 ++++ b/config9.m4 +@@ -24,6 +24,8 @@ if test "$PHP_HTTP" != "no"; then + AC_CHECK_LIB(nsl, getdomainname) + ]) + AC_CHECK_FUNCS(mbrtowc mbtowc iswalnum inet_pton) ++ ++ CFLAGS="$CFLAGS -Wno-strict-prototypes" + + dnl ZLIB + PHP_ARG_WITH([http-zlib-dir], [whether/where to check for zlib], +diff --git a/src/php_http_client_curl.c b/src/php_http_client_curl.c +index 0e79f19..8898b5d 100644 +--- a/src/php_http_client_curl.c ++++ b/src/php_http_client_curl.c +@@ -17,6 +17,8 @@ + + #if PHP_HTTP_HAVE_LIBCURL + ++#define DEBUG_COOKIES 0 ++ + #if PHP_HTTP_HAVE_LIBCURL_OPENSSL + # include <openssl/ssl.h> + #endif +@@ -834,6 +836,9 @@ static ZEND_RESULT_CODE php_http_curle_option_set_cookiesession(php_http_option_ + return FAILURE; + } + if (Z_TYPE_P(val) == IS_TRUE) { ++#if DEBUG_COOKIES ++ fprintf(stderr, "CURLOPT_COOKIELIST: SESS\n"); ++#endif + if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIELIST, "SESS")) { + return FAILURE; + } +@@ -856,9 +861,19 @@ static ZEND_RESULT_CODE php_http_curle_option_set_cookiestore(php_http_option_t } else { storage->cookiestore = NULL; } - if ( CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore) -+ if ( CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore ? storage->cookiestore : "") - || CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore) - ) { +- || CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore) +- ) { ++ ++#if DEBUG_COOKIES ++ fprintf(stderr, "CURLOPT_COOKIEFILE: %s\n", cookiestore); ++#endif ++ // does NOT enable ch->data.cookies until transfer; adds to ch->stsate.cookielist ++ if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore ? storage->cookiestore : "")) { ++ return FAILURE; ++ } ++#if DEBUG_COOKIES ++ fprintf(stderr, "CURLOPT_COOKIEJAR: %s\n", cookiestore); ++#endif ++ // enables ch->data.cookies ++ if (CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore)) { return FAILURE; + } + +@@ -1919,7 +1934,7 @@ static ZEND_RESULT_CODE php_http_curlm_option_set_share_cookies(php_http_option_ + return SUCCESS; + } + +-#if PHP_HTTP_CURL_VERSION(7,23,0) ++#if PHP_HTTP_HAVE_LIBCURL_SHARE_SSL + static ZEND_RESULT_CODE php_http_curlm_option_set_share_ssl(php_http_option_t *opt, zval *value, void *userdata) + { + php_http_client_t *client = userdata; +@@ -1994,7 +2009,7 @@ static void php_http_curlm_options_init(php_http_options_t *registry) + opt->setter = php_http_curlm_option_set_share_cookies; + ZVAL_TRUE(&opt->defval); + } +-#if PHP_HTTP_CURL_VERSION(7,23,0) ++#if PHP_HTTP_HAVE_LIBCURL_SHARE_SSL + if ((opt = php_http_option_register(registry, ZEND_STRL("share_ssl"), 0, _IS_BOOL))) { + opt->setter = php_http_curlm_option_set_share_ssl; + ZVAL_TRUE(&opt->defval); |