summaryrefslogtreecommitdiffstats
path: root/openswoole-oldcurl.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2021-12-20 08:57:31 +0100
committerRemi Collet <remi@php.net>2021-12-20 08:57:31 +0100
commit1fd143a60ceb86c9941a75ba2025cebf6fe9908b (patch)
tree4b92d63a27b42730e4b560ec0669e387da98b569 /openswoole-oldcurl.patch
parent872986b6d6a4e607bfa2bea763450bbab28de07b (diff)
update to 4.9.0
add patch for libcurl < 7.56 (EL-7) from https://github.com/openswoole/swoole-src/pull/103
Diffstat (limited to 'openswoole-oldcurl.patch')
-rw-r--r--openswoole-oldcurl.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/openswoole-oldcurl.patch b/openswoole-oldcurl.patch
new file mode 100644
index 0000000..ef592c0
--- /dev/null
+++ b/openswoole-oldcurl.patch
@@ -0,0 +1,59 @@
+From b0afb66e8d74eeadf0bff02098a1fe154087377c Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Mon, 20 Dec 2021 08:38:43 +0100
+Subject: [PATCH] fix build with old libcurl
+
+---
+ thirdparty/php/curl/interface.cc | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/thirdparty/php/curl/interface.cc b/thirdparty/php/curl/interface.cc
+index 6af19e0dc..c1d7f748e 100644
+--- a/thirdparty/php/curl/interface.cc
++++ b/thirdparty/php/curl/interface.cc
+@@ -381,7 +381,9 @@ static zend_function *swoole_curl_get_constructor(zend_object *object) {
+ static zend_object *swoole_curl_clone_obj(zend_object *object) {
+ php_curl *ch;
+ CURL *cp;
++#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
+ zval *postfields;
++#endif
+ zend_object *clone_object;
+ php_curl *clone_ch;
+
+@@ -399,6 +401,7 @@ static zend_object *swoole_curl_clone_obj(zend_object *object) {
+ clone_ch->cp = cp;
+ swoole_setup_easy_copy_handlers(clone_ch, ch);
+
++#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
+ postfields = &clone_ch->postfields;
+ if (Z_TYPE_P(postfields) != IS_UNDEF) {
+ if (build_mime_structure_from_hash(clone_ch, postfields) != SUCCESS) {
+@@ -406,6 +409,7 @@ static zend_object *swoole_curl_clone_obj(zend_object *object) {
+ return &clone_ch->std;
+ }
+ }
++#endif
+
+ return &clone_ch->std;
+ }
+@@ -415,7 +419,9 @@ static HashTable *swoole_curl_get_gc(zend_object *object, zval **table, int *n)
+
+ zend_get_gc_buffer *gc_buffer = zend_get_gc_buffer_create();
+
++#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
+ zend_get_gc_buffer_add_zval(gc_buffer, &curl->postfields);
++#endif
+ if (curl_handlers(curl)) {
+ if (curl_handlers(curl)->read) {
+ zend_get_gc_buffer_add_zval(gc_buffer, &curl_handlers(curl)->read->func_name);
+@@ -2835,7 +2841,9 @@ static void _php_curl_free(php_curl *ch) {
+ efree(ch->handlers);
+ #endif
+
++#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
+ zval_ptr_dtor(&ch->postfields);
++#endif
+
+ #if PHP_VERSION_ID >= 80100
+ zval_ptr_dtor(&ch->private_data);