8000 ext/curl: Refactor cURL to only use FCC by Girgias · Pull Request #13291 · php/php-src · GitHub
[go: up one dir, main page]

Skip to content

ext/curl: Refactor cURL to only use FCC #13291

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

Merged
merged 15 commits into from
May 1, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
ext/curl: Remove workaround for old libcurl
  • Loading branch information
Girgias committed Apr 30, 2024
commit 51c8e216abb9290836f8dbc24489aa246e6b1fac
23 changes: 0 additions & 23 deletions ext/curl/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,6 @@ PHP_MSHUTDOWN_FUNCTION(curl)
}
/* }}} */

/* {{{ curl_write_nothing
* Used as a work around. See _php_curl_close_ex
*/
static size_t curl_write_nothing(char *data, size_t size, size_t nmemb, void *ctx)
{
return size * nmemb;
}
/* }}} */

/* {{{ curl_write */
static size_t curl_write(char *data, size_t size, size_t nmemb, void *ctx)
{
Expand Down Expand Up @@ -2742,20 +2733,6 @@ static void curl_free_obj(zend_object *object)

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

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

curl_easy_cleanup(ch->cp);

/* cURL destructors should be invoked only by last curl handle */
Expand Down
0