From c06902713998d68202c5a764de910ba8d0e8f54d Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 27 Apr 2020 00:33:21 +0200 Subject: conncache: various concept cleanups More connection cache accesses are protected by locks. CONNCACHE_* is a beter prefix for the connection cache lock macros. Curl_attach_connnection: now called as soon as there's a connection struct available and before the connection is added to the connection cache. Curl_disconnect: now assumes that the connection is already removed from the connection cache. Ref: #4915 Closes #5009 --- tests/data/test1554 | 14 ++++++++++++++ tests/unit/unit1620.c | 6 +----- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/data/test1554 b/tests/data/test1554 index 06f189724..d3926d916 100644 --- a/tests/data/test1554 +++ b/tests/data/test1554 @@ -29,6 +29,12 @@ run 1: foobar and so on fun! <- Mutex unlock -> Mutex lock <- Mutex unlock +-> Mutex lock +<- Mutex unlock +-> Mutex lock +<- Mutex unlock +-> Mutex lock +<- Mutex unlock run 1: foobar and so on fun! -> Mutex lock <- Mutex unlock @@ -40,6 +46,10 @@ run 1: foobar and so on fun! <- Mutex unlock -> Mutex lock <- Mutex unlock +-> Mutex lock +<- Mutex unlock +-> Mutex lock +<- Mutex unlock run 1: foobar and so on fun! -> Mutex lock <- Mutex unlock @@ -51,6 +61,10 @@ run 1: foobar and so on fun! <- Mutex unlock -> Mutex lock <- Mutex unlock +-> Mutex lock +<- Mutex unlock +-> Mutex lock +<- Mutex unlock run 1: foobar and so on fun! -> Mutex lock <- Mutex unlock diff --git a/tests/unit/unit1620.c b/tests/unit/unit1620.c index 6e572c648..b23e5b912 100644 --- a/tests/unit/unit1620.c +++ b/tests/unit/unit1620.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -73,10 +73,6 @@ UNITTEST_START fail_unless(rc == CURLE_OK, "Curl_parse_login_details() failed"); - rc = Curl_disconnect(empty, empty->conn, FALSE); - fail_unless(rc == CURLE_OK, - "Curl_disconnect() with dead_connection set FALSE failed"); - Curl_freeset(empty); for(i = (enum dupstring)0; i < STRING_LAST; i++) { fail_unless(empty->set.str[i] == NULL, -- cgit v1.2.3