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/23 19:44] – make changes suggested by rlanders 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: Under Discussion+  * 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 58: Line 68:
   * We may want to put together an RFC in the future for a new internal API for persistence.   * We may want to put together an RFC in the future for a new internal API for persistence.
  
-===== Proposed Voting Choices =====+===== Voting Choices =====
  
-This vote would require a ⅔ majority:+Voting started on 2024-10-24 and will end on 2024-11-08 00:00 UTC.
  
-^ Add ''curl_share_init(?array $share_options, ?string $persistent_id)'' in the next PHP minor release ^ +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="true" closeon="2024-11-08T00:00:00Z">
 +   * Yes
 +   * No
 +</doodle>
  
 ===== Patches and Tests ===== ===== Patches and Tests =====
Line 76: 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.1729712664.txt.gz · Last modified: 2024/10/23 19:44 by enorris