On 25/10/2024 19:18, Dmitry Karpov via curl-library wrote:
You don't really need to set CURLMOPT_MAX_TOTAL_CONNECTIONS = 1 to use HTTP2 
multiplexing.

You basically need to do the following steps:
  1. Enable HTTP multiplexing by setting CURLMOPT_PIPELINING option on a 
multi-handle with CURLPIPE_MULTIPLEX flag.
  2. Set CURLOPT_PIPEWAIT option to 1 on easy handle for each transfer you add 
to that multi-handle.

The last setting will force the transfer to wait until the HTTP2 pipeline is 
ready and not try to open a new connection.

Ok, fair. What I was doing did feel like a cludge.

I was confused by the docs on CURLMOPT_MAX_PIPELINE_LENGTH which say "removed in 7.62.0"

But yes.

curl_multi_setopt(curl_multi_handle, CURLMOPT_PIPELINING, CURLPIPE_MULTIPLEX); // this is the default anyway

Plus

curl_easy_setopt(handle, CURLOPT_PIPEWAIT, 1L);

certainly works to enable / force the high performance HTTP2 mode, and is much cleaner and clearer.

Thanks!

Oliver
--
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html

Reply via email to