curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Re: CURLOPT_FORBID_REUSE when multiplexing

From: vigorous-neatness--- via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 8 Sep 2026 15:41:37 -0500

Spurred by this particular thread, I threw something together to make an actual _correct_ way to accomplish that particular task: https://github.com/curl/curl/pull/22854

See from discussion that current proposed direction is a new value for CURLOPT_FRESH_CONNECT, which I intend to throw together probably this coming weekend.

Thanks,

Logan

> On Sep 8, 2026, at 15:15, Dmitry Karpov via curl-library <noreply-vigorous-neatness_at_oantby.com> wrote:
>
> Is there any option to forbid reusing a connection for multiplexed transfers without destroying the whole connection pool along with a multi-handle?
> This may be very useful when some multiplexed connection to a certain host became slow and needs restarting.
>
> Obviously, this can be done by recreating a multi-handle which will destroy the whole connection pool, but it can't be done if the multi is performing some transfers.
>
> Ideally, the CURLOPT_FORBID_REUSE in the multiplexing case should mark the multiplexed connection as "expired",
> and when the last ongoing multiplexed transfer is completed, the connection pool should close it.
>
> Otherwise, it will be very difficult for clients to restart multiplexed connections once they become slow.
>
> Thanks,
> Dmitry Karpov
>
>
> -----Original Message-----
> From: curl-library <curl-library-bounces_at_lists.haxx.se> On Behalf Of Daniel Stenberg via curl-library
> Sent: Saturday, September 5, 2026 3:12 AM
> To: libcurl hacking <curl-library_at_lists.haxx.se>
> Cc: Daniel Stenberg <daniel_at_haxx.se>
> Subject: [EXTERNAL] CURLOPT_FORBID_REUSE when multiplexing
>
> Hey all.
>
> For decades libcurl has offered the CURLOPT_FORBID_REUSE option. When each transfer uses a connection exclusively, it is easy to say and understand that this option marks this as the last transfer on the connection. It cannot be reused again for any further transfers.
>
> When used for a transfer that is multiplexed together with other transfers over the same connection, this option's meaning and functionality is unclear.
>
> I propose we start by explicitly documenting the fact that this option has no effect on multiplexed transfers to avoid surprising users.
>
> See https://github.com/curl/curl/pull/22833
>
> Thoughts?
>
> --
>
> / daniel.haxx.se || https://rock-solid.curl.dev
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette: https://curl.se/mail/etiquette.html
> --
> Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
> Etiquette: https://curl.se/mail/etiquette.html


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2026-09-08