curl / Mailing Lists / curl-library / Single Mail

curl-library

Wrong connection reuse - curl_easy_send/recv with curl_multi

From: Pavel Löbl via curl-library <curl-library_at_cool.haxx.se>
Date: Thu, 14 Feb 2019 16:21:41 +0100

I want to use CURLOPT_CONNECT_ONLY/CURLINFO_ACTIVESOCKET with
curl_easy_send/recv to implement custom protocol using curl multi
interface.

I have multiple connections to the same host (behind a proxy). One of
them is marked with CURLOPT_CONNECT_ONLY. This one I want to use for
custom protocol traffic. However when another usual http request is
made curl will reuse the previous "connect only" connection. Thus
blocking me from using it for custom stuff.

If I add CURLOPT_FORBID_REUSE it is closed immediately after connect.

It just seems curl considers the connection as finished and ready to
be reused which is not true for curl_easy_send/recv use case.

I'm not sure how to solve this without affecting existing
implementations. If new option would be needed to support recv/send
without breaking current behavior of CURLOPT_CONNECT_ONLY option.

Or am I just doing something wrong?

Pavel
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2019-02-14