]> granicus.if.org Git - curl/commitdiff
conncache_unlock: avoid indirection by changing input argument type
authorDaniel Stenberg <daniel@haxx.se>
Thu, 20 Dec 2018 15:51:44 +0000 (16:51 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 22 Dec 2018 17:14:56 +0000 (18:14 +0100)
lib/conncache.c
lib/conncache.h
lib/url.c

index 080441854c361b9ce5e6b711a85cb09389148e56..0ac38497c47304a201812880a52e2c4f4a64fb8b 100644 (file)
@@ -178,9 +178,9 @@ static void hashkey(struct connectdata *conn, char *buf,
   msnprintf(buf, len, "%ld%s", conn->port, hostname);
 }
 
-void Curl_conncache_unlock(struct connectdata *conn)
+void Curl_conncache_unlock(struct Curl_easy *data)
 {
-  CONN_UNLOCK(conn->data);
+  CONN_UNLOCK(data);
 }
 
 /* Returns number of connections currently held in the connection cache.
index 81566dcd345b41834645baab687f8a125b0b5992..0df6d47154b61a7d3add5b985be4076d1fdfd108 100644 (file)
@@ -56,7 +56,7 @@ void Curl_conncache_destroy(struct conncache *connc);
 /* return the correct bundle, to a host or a proxy */
 struct connectbundle *Curl_conncache_find_bundle(struct connectdata *conn,
                                                  struct conncache *connc);
-void Curl_conncache_unlock(struct connectdata *conn);
+void Curl_conncache_unlock(struct Curl_easy *data);
 /* returns number of connections currently held in the connection cache */
 size_t Curl_conncache_size(struct Curl_easy *data);
 size_t Curl_conncache_bundle_size(struct connectdata *conn);
index 2ec45873fb4e1306a063cb33b6137fd885b2b7ed..50719ce548de861d5beed064b0d473400a1ec7d5 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1097,7 +1097,7 @@ ConnectionExists(struct Curl_easy *data,
         if((bundle->multiuse == BUNDLE_UNKNOWN) && data->set.pipewait) {
           infof(data, "Server doesn't support multi-use yet, wait\n");
           *waitpipe = TRUE;
-          Curl_conncache_unlock(needle);
+          Curl_conncache_unlock(data);
           return FALSE; /* no re-use */
         }
 
@@ -1457,11 +1457,11 @@ ConnectionExists(struct Curl_easy *data,
   if(chosen) {
     /* mark it as used before releasing the lock */
     chosen->data = data; /* own it! */
-    Curl_conncache_unlock(needle);
+    Curl_conncache_unlock(data);
     *usethis = chosen;
     return TRUE; /* yes, we found one to use! */
   }
-  Curl_conncache_unlock(needle);
+  Curl_conncache_unlock(data);
 
   if(foundPendingCandidate && data->set.pipewait) {
     infof(data,
@@ -3950,7 +3950,7 @@ static CURLcode create_conn(struct Curl_easy *data,
 
         /* The bundle is full. Extract the oldest connection. */
         conn_candidate = Curl_conncache_extract_bundle(data, bundle);
-        Curl_conncache_unlock(conn);
+        Curl_conncache_unlock(data);
 
         if(conn_candidate)
           (void)Curl_disconnect(data, conn_candidate,
@@ -3962,7 +3962,7 @@ static CURLcode create_conn(struct Curl_easy *data,
         }
       }
       else
-        Curl_conncache_unlock(conn);
+        Curl_conncache_unlock(data);
 
     }