mirror of
https://github.com/curl/curl.git
synced 2026-08-09 13:04:18 +03:00
url: reduce complexity of url_match_conn
Split off the function code into several static helpers according to aspects checked. closes #17408
This commit is contained in:
parent
e1f65937a9
commit
35e1e7be22
3 changed files with 294 additions and 178 deletions
|
|
@ -832,6 +832,8 @@ void Curl_detach_connection(struct Curl_easy *data)
|
|||
struct connectdata *conn = data->conn;
|
||||
if(conn) {
|
||||
Curl_uint_spbset_remove(&conn->xfers_attached, data->mid);
|
||||
if(Curl_uint_spbset_empty(&conn->xfers_attached))
|
||||
conn->attached_multi = NULL;
|
||||
}
|
||||
data->conn = NULL;
|
||||
}
|
||||
|
|
@ -849,6 +851,11 @@ void Curl_attach_connection(struct Curl_easy *data,
|
|||
DEBUGASSERT(conn);
|
||||
data->conn = conn;
|
||||
Curl_uint_spbset_add(&conn->xfers_attached, data->mid);
|
||||
/* all attached transfers must be from the same multi */
|
||||
if(!conn->attached_multi)
|
||||
conn->attached_multi = data->multi;
|
||||
DEBUGASSERT(conn->attached_multi == data->multi);
|
||||
|
||||
if(conn->handler && conn->handler->attach)
|
||||
conn->handler->attach(data, conn);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue