Page MenuHomePhabricator

Check that curl is new enough to support CURLMOPT_MAX_HOST_CONNECTIONS
Closed, ResolvedPublic

Description

There are some complaints on support desk about CURLMOPT_MAX_HOST_CONNECTIONS being undefined.

We should check if curl is new enough to support that, and only set it if it is. If whatever that is is critical we should check it during environment checks in the installer.

https://www.mediawiki.org/wiki/Topic:Vvc5elrbv3fpukde

Event Timeline

Introduced in T232128: Make MultiHttpClient use CURLMOPT_MAX_HOST_CONNECTIONS and reuse connections (check the linked Gerrit patch in there for the code changes that were introduced).

Code in mediawiki/core repository is the line
curl_multi_setopt( $this->cmh, CURLMOPT_MAX_HOST_CONNECTIONS, (int)$maxHostConns );
in the file /includes/libs/http/MultiHttpClient.php.

Upstream docs at https://curl.haxx.se/libcurl/c/CURLMOPT_MAX_HOST_CONNECTIONS.html says that this was introduced in curl version 7.30.0.

https://www.php.net/manual/en/function.curl-version.php explains how to check the curl version in PHP.

Hence adding good first task.

Change 644639 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Make use of CURLMOPT_MAX_HOST_CONNECTIONS conditional on having curl >= 7.30.0

https://gerrit.wikimedia.org/r/644639

Change 644639 merged by jenkins-bot:
[mediawiki/core@master] Make use of CURLMOPT_MAX_HOST_CONNECTIONS conditional on having curl >= 7.30.0

https://gerrit.wikimedia.org/r/644639

Change 654858 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@REL1_35] Make use of CURLMOPT_MAX_HOST_CONNECTIONS conditional on having curl >= 7.30.0

https://gerrit.wikimedia.org/r/654858

Reedy claimed this task.

Change 654858 merged by jenkins-bot:
[mediawiki/core@REL1_35] Make use of CURLMOPT_MAX_HOST_CONNECTIONS conditional on having curl >= 7.30.0

https://gerrit.wikimedia.org/r/654858