curl / Mailing Lists / curl-library / Single Mail

curl-library

Re: Lack of connection re-use from cache when LOCALPORT/LOCALPORTRANGE has been specified but INTERFACE has not

From: bjt 3 <bjt3_at_hotmail.com>
Date: Tue, 22 Nov 2016 13:28:00 +0000

On 11/21/2016 10:55 AM, bjt 3 wrote:

I've noticed an application creating a new connection for each request in a set when the

...

My question is, is this coded as intended or overly restrictive ? If the former, I'd very much like to understand why so as to improve my understanding of libcurl.

interesting. this would loosen it a little:

diff --git a/lib/url.c b/lib/url.c
index 7106d46..5d0e21a 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3400,9 +3400,9 @@ ConnectionExists(struct Curl_easy *data,
         */
         if((check->localport != needle->localport) ||
            (check->localportrange != needle->localportrange) ||
- !check->localdev ||
- !needle->localdev ||
- strcmp(check->localdev, needle->localdev))
+ ((check->localdev && needle->localdev) ?
+ strcmp(check->localdev, needle->localdev) :
+ (check->localdev || needle->localdev)))
           continue;
       }

Thanks. This matches some experiments that I did, and leads me to infer that you don't necessarily believe that the current code should be so strict. Is it reasonable to further believe that needle->localdev == NULL should match any check->localdev value ?

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-11-22