rfc:curl_share_persistence

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
rfc:curl_share_persistence [2024/10/24 18:14] – open RFC for voting enorrisrfc:curl_share_persistence [2025/01/02 15:08] (current) – add link to curl_share_persistence_improvement RFC enorris
Line 1: Line 1:
 ====== PHP RFC: Add persistent curl share handles ====== ====== PHP RFC: Add persistent curl share handles ======
-  * Version: 1.1+  * Version: 1.3
   * Date: 2024-10-09   * Date: 2024-10-09
   * Author: Eric Norris, erictnorris@gmail.com   * Author: Eric Norris, erictnorris@gmail.com
-  * Status: Voting+  * Status: Accepted
   * First Published at: http://wiki.php.net/rfc/curl_share_persistence   * First Published at: http://wiki.php.net/rfc/curl_share_persistence
 +  * Superseded by: http://wiki.php.net/rfc/curl_share_persistence_improvement
  
 ===== Introduction ===== ===== Introduction =====
Line 23: Line 24:
  
 If a curl share handle does not already exist, the function will construct a new one, apply the given share options, store it in global memory, and return it. If a curl share handle does not already exist, the function will construct a new one, apply the given share options, store it in global memory, and return it.
 +
 +==== Safety ====
 +
 +Since curl share handles are stateful, developers must consider whether a given ''CURL_LOCK_DATA_*'' constant is safe to use in a persistent context.
 +
 +  * ''CURL_LOCK_DATA_CONNECT'' and ''CURL_LOCK_DATA_SSL_SESSION'' is safe to use; curl will not reuse connections between ''CurlHandle'' objects unless the connection settings (e.g. TLS client certificates) match.
 +  * ''CURL_LOCK_DATA_COOKIE'' is **not** safe to use when making downstream requests on behalf of users; developers must take care to ensure that authentication cookies, etc. are not shared between separate users.
 +  * ''CURL_LOCK_DATA_DNS'' is safe to use.
 +  * ''CURL_LOCK_DATA_PSL'' is safe to use.
  
 ===== Backward Incompatible Changes ===== ===== Backward Incompatible Changes =====
Line 64: Line 74:
 This vote requires a ⅔ majority: This vote requires a ⅔ majority:
  
-<doodle title="Add curl_share_init(?array $share_options, ?string $persistent_id) in the next PHP minor release" auth="enorris" voteType="single" closed="false" closeon="2024-11-08T00:00:00Z">+<doodle title="Add curl_share_init(?array $share_options, ?string $persistent_id) in the next PHP minor release" auth="enorris" voteType="single" closed="true" closeon="2024-11-08T00:00:00Z">
    * Yes    * Yes
    * No    * No
Line 79: Line 89:
  
   * https://wiki.php.net/rfc/resource_to_object_conversion   * https://wiki.php.net/rfc/resource_to_object_conversion
 +  * https://github.com/curl/curl/pull/1917 - curl pull request demonstrating their position on connection reuse with TLS settings
 ===== Rejected Features ===== ===== Rejected Features =====
  
rfc/curl_share_persistence.1729793689.txt.gz · Last modified: 2024/10/24 18:14 by enorris