urldata: rename easy_conn to just conn

We use "conn" everywhere to be a pointer to the connection.

Introduces two functions that "attaches" and "detaches" the connection
to and from the transfer.

Going forward, we should favour using "data->conn" (since a transfer
always only has a single connection or none at all) to "conn->data"
(since a connection can have none, one or many transfers associated with
it and updating conn->data to be correct is error prone and a frequent
reason for internal issues).

Closes #3442
This commit is contained in:
Daniel Stenberg 2019-01-02 18:04:58 +01:00
parent 61faa0b420
commit ba243235ec
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
15 changed files with 199 additions and 204 deletions

View file

@ -48,7 +48,7 @@ UNITTEST_START
rc = Curl_open(&empty);
fail_unless(rc == CURLE_OK, "Curl_open() failed");
rc = Curl_connect(empty, &empty->easy_conn, &async, &protocol_connect);
rc = Curl_connect(empty, &async, &protocol_connect);
fail_unless(rc == CURLE_URL_MALFORMAT,
"Curl_connect() failed to return CURLE_URL_MALFORMAT");
@ -56,14 +56,14 @@ UNITTEST_START
"empty->magic should be equal to CURLEASY_MAGIC_NUMBER");
/* double invoke to ensure no dependency on internal state */
rc = Curl_connect(empty, &empty->easy_conn, &async, &protocol_connect);
rc = Curl_connect(empty, &async, &protocol_connect);
fail_unless(rc == CURLE_URL_MALFORMAT,
"Curl_connect() failed to return CURLE_URL_MALFORMAT");
rc = Curl_init_userdefined(empty);
fail_unless(rc == CURLE_OK, "Curl_userdefined() failed");
rc = Curl_init_do(empty, empty->easy_conn);
rc = Curl_init_do(empty, empty->conn);
fail_unless(rc == CURLE_OK, "Curl_init_do() failed");
rc = Curl_parse_login_details(
@ -71,7 +71,7 @@ UNITTEST_START
fail_unless(rc == CURLE_OK,
"Curl_parse_login_details() failed");
rc = Curl_disconnect(empty, empty->easy_conn, FALSE);
rc = Curl_disconnect(empty, empty->conn, FALSE);
fail_unless(rc == CURLE_OK,
"Curl_disconnect() with dead_connection set FALSE failed");