mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-23 15:07:03 +01:00
http: Add a flag to the URL parser indicating a literal v6 address.
* common/http.h (struct parsed_uri_t): Add field v6lit. * common/http.c (do_parse_uri): Set v6lit.
This commit is contained in:
parent
781b941743
commit
3d9e0eb02c
@ -781,6 +781,7 @@ do_parse_uri (parsed_uri_t uri, int only_local_part, int no_scheme_check)
|
|||||||
uri->use_tls = 0;
|
uri->use_tls = 0;
|
||||||
uri->is_http = 0;
|
uri->is_http = 0;
|
||||||
uri->opaque = 0;
|
uri->opaque = 0;
|
||||||
|
uri->v6lit = 0;
|
||||||
|
|
||||||
/* A quick validity check. */
|
/* A quick validity check. */
|
||||||
if (strspn (p, VALID_URI_CHARS) != n)
|
if (strspn (p, VALID_URI_CHARS) != n)
|
||||||
@ -841,6 +842,7 @@ do_parse_uri (parsed_uri_t uri, int only_local_part, int no_scheme_check)
|
|||||||
*p3++ = '\0';
|
*p3++ = '\0';
|
||||||
/* worst case, uri->host should have length 0, points to \0 */
|
/* worst case, uri->host should have length 0, points to \0 */
|
||||||
uri->host = p + 1;
|
uri->host = p + 1;
|
||||||
|
uri->v6lit = 1;
|
||||||
p = p3;
|
p = p3;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -51,6 +51,7 @@ struct parsed_uri_s
|
|||||||
unsigned int is_http:1; /* This is a HTTP style URI. */
|
unsigned int is_http:1; /* This is a HTTP style URI. */
|
||||||
unsigned int use_tls:1; /* Whether TLS should be used. */
|
unsigned int use_tls:1; /* Whether TLS should be used. */
|
||||||
unsigned int opaque:1;/* Unknown scheme; PATH has the rest. */
|
unsigned int opaque:1;/* Unknown scheme; PATH has the rest. */
|
||||||
|
unsigned int v6lit:1; /* Host was given as a literal v6 address. */
|
||||||
char *auth; /* username/password for basic auth. */
|
char *auth; /* username/password for basic auth. */
|
||||||
char *host; /* Host (converted to lowercase). */
|
char *host; /* Host (converted to lowercase). */
|
||||||
unsigned short port; /* Port (always set if the host is set). */
|
unsigned short port; /* Port (always set if the host is set). */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user