aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Satiro <raysatiro@yahoo.com>2016-11-22 16:10:06 -0500
committerJay Satiro <raysatiro@yahoo.com>2016-11-22 16:10:06 -0500
commit3e9c0230f45cafb9154bb4fcdc8ff2b51f00701a (patch)
treee5eb691c8bde22f8c122b3f5a74916d1e58e854d
parentf18f7bf934233146b18d087658224d734c6d0791 (diff)
url: Fix conn reuse for local ports and interfaces
- Fix connection reuse for when the proposed new conn 'needle' has a specified local port but does not have a specified device interface. Bug: https://curl.haxx.se/mail/lib-2016-11/0137.html Reported-by: bjt3[at]hotmail.com
-rw-r--r--lib/url.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index 7106d46d4..552be9468 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -3400,9 +3400,8 @@ ConnectionExists(struct Curl_easy *data,
*/
if((check->localport != needle->localport) ||
(check->localportrange != needle->localportrange) ||
- !check->localdev ||
- !needle->localdev ||
- strcmp(check->localdev, needle->localdev))
+ (needle->localdev &&
+ (!check->localdev || strcmp(check->localdev, needle->localdev))))
continue;
}