]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: only reuse connections with same GSS delegation
authorDaniel Stenberg <daniel@haxx.se>
Fri, 10 Mar 2023 08:22:43 +0000 (09:22 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 10 Mar 2023 22:30:34 +0000 (23:30 +0100)
Reported-by: Harry Sintonen
Closes #10731

lib/url.c
lib/urldata.h

index df6ef12134536e65453996ffa58c749de5cdb482..cc2f427dc3d87ff78d11aa1c36102164b641af28 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1279,6 +1279,11 @@ ConnectionExists(struct Curl_easy *data,
         }
       }
 
+      /* GSS delegation differences do not actually affect every connection
+         and auth method, but this check takes precaution before efficiency */
+      if(needle->gssapi_delegation != check->gssapi_delegation)
+        continue;
+
       /* If multiplexing isn't enabled on the h2 connection and h1 is
          explicitly requested, handle it: */
       if((needle->handler->protocol & PROTO_FAMILY_HTTP) &&
@@ -1573,6 +1578,7 @@ static struct connectdata *allocate_conn(struct Curl_easy *data)
   conn->fclosesocket = data->set.fclosesocket;
   conn->closesocket_client = data->set.closesocket_client;
   conn->lastused = Curl_now(); /* used now */
+  conn->gssapi_delegation = data->set.gssapi_delegation;
 
   return conn;
   error:
index bf5daaf5067dc9b3e74b688ff2a70436b680a1a1..da5de5ba94e8e31bcca5229a3839612b0599c890 100644 (file)
@@ -1061,6 +1061,7 @@ struct connectdata {
   unsigned char ip_version; /* copied from the Curl_easy at creation time */
   unsigned char httpversion; /* the HTTP version*10 reported by the server */
   unsigned char connect_only;
+  unsigned char gssapi_delegation; /* inherited from set.gssapi_delegation */
 };
 
 /* The end of connectdata. */