Re: [RFC] Vetting cURL connections with CURLOPT_OPENSOCKETFUNCTION
| From: | Tim Düsterhus | Date: | Fri, 20 Nov 2026 11:40:32 +0000 |
| Subject: | Re: [RFC] Vetting cURL connections with CURLOPT_OPENSOCKETFUNCTION | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-133141@lists.php.net to get a copy of this message | ||
Hi
On 2026-11-12 13:47, Xavier Leune wrote:
Thanks for your feedback. I dropped the enum, you're right the new api is more consistent with other curl callbacks. PR, RFC and polyfill are up to date,I noticed:
The only address the callback cannot classify is a relative socket path that looks like an IP, such as a file named 10.0.0.5. That path comes from CURLOPT_UNIX_SOCKET_PATH, which is set by the application, not by the URL.in the updated RFC. Even though a Unix socket comes from the application, this type confusion is unfortunate. I wonder if it would make sense to pass in either a URI string like
unix:/var/run/docker.sock or tcp://127.0.0.1:80 that folks can then part with Uri\Rfc3986\Uri or perhaps to even pass in a Uri\Rfc3986\Uri object directly. That would also provide the “port” handling and possibly normalization for free and avoid the use of two parameters to represent a single logical value, making it easier to extend the API with additional parameters in the future, as noted previously (“The leading parameters are the only part that cannot change later”).
---------
I've read the full RFC and (for now) have no comments other than the above. Thank you!
Best regards
Tim Düsterhus