Skip to content

Commit 257ffe9

Browse files
committed
ext/curl: Remove workaround for old libcurl
1 parent 11bf042 commit 257ffe9

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
@@ -555,15 +555,6 @@ PHP_MSHUTDOWN_FUNCTION(curl)
555555
}
556556
/* }}} */
557557

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

26802671
_php_curl_verify_handlers(ch, /* reporterror */ false);
26812672

2682-
/*
2683-
* Libcurl is doing connection caching. When easy handle is cleaned up,
2684-
* if the handle was previously used by the curl_multi_api, the connection
2685-
* remains open un the curl multi handle is cleaned up. Some protocols are
2686-
* sending content like the FTP one, and libcurl try to use the
2687-
* WRITEFUNCTION or the HEADERFUNCTION. Since structures used in those
2688-
* callback are freed, we need to use an other callback to which avoid
2689-
* segfaults.
2690-
*
2691-
* Libcurl commit d021f2e8a00 fix this issue and should be part of 7.28.2
2692-
*/
2693-
curl_easy_setopt(ch->cp, CURLOPT_HEADERFUNCTION, curl_write_nothing);
2694-
curl_easy_setopt(ch->cp, CURLOPT_WRITEFUNCTION, curl_write_nothing);
2695-
26962673
curl_easy_cleanup(ch->cp);
26972674

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

0 commit comments

Comments
 (0)