Skip to content

Commit 12c19a0

Browse files
committed
ext/curl: Remove workaround for old libcurl
1 parent 5a88501 commit 12c19a0

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

ext/curl/interface.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -556,15 +556,6 @@ PHP_MSHUTDOWN_FUNCTION(curl)
556556
}
557557
/* }}} */
558558

559-
/* {{{ curl_write_nothing
560-
* Used as a work around. See _php_curl_close_ex
561-
*/
562-
static size_t curl_write_nothing(char *data, size_t size, size_t nmemb, void *ctx)
563-
{
564-
return size * nmemb;
565-
}
566-
/* }}} */
567-
568559
/* {{{ curl_write */
569560
static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
570561
{
@@ -2742,20 +2733,6 @@ static void curl_free_obj(zend_object *object)
27422733

27432734
_php_curl_verify_handlers(ch, /* reporterror */ false);
27442735

2745-
/*
2746-
* Libcurl is doing connection caching. When easy handle is cleaned up,
2747-
* if the handle was previously used by the curl_multi_api, the connection
2748-
* remains open un the curl multi handle is cleaned up. Some protocols are
2749-
* sending content like the FTP one, and libcurl try to use the
2750-
* WRITEFUNCTION or the HEADERFUNCTION. Since structures used in those
2751-
* callback are freed, we need to use an other callback to which avoid
2752-
* segfaults.
2753-
*
2754-
* Libcurl commit d021f2e8a00 fix this issue and should be part of 7.28.2
2755-
*/
2756-
curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_nothing);
2757-
curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write_nothing);
2758-
27592736
curl_easy_cleanup(ch->cp);
27602737

27612738
/* cURL destructors should be invoked only by last curl handle */

0 commit comments

Comments
 (0)