Re: [RFC] Vetting cURL connections with CURLOPT_OPENSOCKETFUNCTION
| From: | Xavier Leune | Date: | Wed, 25 Nov 2026 19:47:25 +0000 |
| Subject: | Re: [RFC] Vetting cURL connections with CURLOPT_OPENSOCKETFUNCTION | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-133223@lists.php.net to get a copy of this message | ||
Hi,
> 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”).
Great idea, I've done a deep dig to check all edge cases around ip and
everything seems fine.
I'll update the RFC in the coming days, along with the implementation and
the polyfill. I'll reach out here then.
Best regards,
Xavier
Le ven. 20 nov. 2026 à 12:40, Tim Düsterhus <tim@bastelstu.be> a écrit :
> 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
>