mirror of
https://github.com/curl/curl.git
synced 2026-08-26 05:13:31 +03:00
urlpieces: remove members that live in peers/creds
Remove members of `struct urlpieces` that now live in peers/creds. Change all remaining uses of those urlpieces. When comparing schemes, use the protocol constants. Closes #22171
This commit is contained in:
parent
cfc7922377
commit
18475e662c
11 changed files with 65 additions and 54 deletions
17
lib/urlapi.c
17
lib/urlapi.c
|
|
@ -2108,3 +2108,20 @@ bool Curl_url_same_origin(CURLU *base, CURLU *href)
|
|||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
CURLUcode Curl_url_get_port(CURLU *u, uint16_t *pport)
|
||||
{
|
||||
if(u->port_present) {
|
||||
*pport = u->portnum;
|
||||
return CURLUE_OK;
|
||||
}
|
||||
else if(u->scheme) {
|
||||
const struct Curl_scheme *s = Curl_get_scheme(u->scheme);
|
||||
if(s && s->defport) {
|
||||
*pport = s->defport;
|
||||
return CURLUE_OK;
|
||||
}
|
||||
}
|
||||
*pport = 0;
|
||||
return CURLUE_NO_PORT;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue