]> git.ipfire.org Git - thirdparty/git.git/commit - urlmatch.h
urlmatch: split host and port fields in `struct url_info`
authorPatrick Steinhardt <patrick.steinhardt@elego.de>
Tue, 31 Jan 2017 09:01:45 +0000 (10:01 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 Jan 2017 18:06:54 +0000 (10:06 -0800)
commit3ec6e6e8a0870a32357689e2179d845700539623
treeff4d6c2dc81e47ef113a9cec2e3ad5ab637f470c
parent3e6a0e64a47497d1addaf063e13865c67cbeb009
urlmatch: split host and port fields in `struct url_info`

The `url_info` structure contains information about a normalized URL
with the URL's components being represented by different fields. The
host and port part though are to be accessed by the same `host` field,
so that getting the host and/or port separately becomes more involved
than really necessary.

To make the port more readily accessible, split up the host and port
fields. Namely, the `host_len` will not include the port length anymore
and a new `port_off` field has been added which includes the offset to
the port, if available.

The only user of these fields is `url_normalize_1`. This change makes it
easier later on to treat host and port differently when introducing
globs for domains.

Signed-off-by: Patrick Steinhardt <patrick.steinhardt@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
urlmatch.c
urlmatch.h