mirror of
https://github.com/curl/curl.git
synced 2026-08-24 22:03:33 +03:00
urlapi: do not keep an internal port string
Do not allocated an internal port string, just keep and number and a bit if it is present. Format the port string in a local buffer when someone asks for it and copy that. This avoid the format/alloc penalty when parsing URLs and no one ever asking for the port string. (And there will be a method to get the uint16_t value directly in another PR) Closes #22167
This commit is contained in:
parent
d2fe26cfe2
commit
26c6a4d898
2 changed files with 49 additions and 45 deletions
|
|
@ -34,11 +34,11 @@ struct Curl_URL {
|
|||
char *options; /* IMAP only? */
|
||||
char *host;
|
||||
char *zoneid; /* for numerical IPv6 addresses */
|
||||
char *port;
|
||||
char *path;
|
||||
char *query;
|
||||
char *fragment;
|
||||
unsigned short portnum; /* the numerical version (if 'port' is set) */
|
||||
uint16_t portnum; /* the numerical port if present */
|
||||
BIT(port_present); /* to support missing port */
|
||||
BIT(query_present); /* to support blank */
|
||||
BIT(fragment_present); /* to support blank */
|
||||
BIT(guessed_scheme); /* when a URL without scheme is parsed */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue