Re: [PATCH v6 2/6] config: add helper to normalize and match URLs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Jul 31, 2013, at 12:26, Junio C Hamano wrote:

From: "Kyle J. McKay" <mackyle@xxxxxxxxx>

Some http.* configuration variables need to take values customized
for the URL we are talking to.  We may want to set http.sslVerify to
true in general but to false only for a certain site, for example,
with a configuration file like this:
[...]
urlmatch.c | 468 ++++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++
urlmatch.h |  36 +++++
2 files changed, 504 insertions(+)
create mode 100644 urlmatch.c
create mode 100644 urlmatch.h

diff --git a/urlmatch.c b/urlmatch.c
new file mode 100644
index 0000000..e1b03ee
--- /dev/null
+++ b/urlmatch.c
[...]
+
+static size_t http_options_url_match_prefix(const char *url,
+					    const char *url_prefix,
+					    size_t url_prefix_len)
+{
+	/*
+ * url_prefix matches url if url_prefix is an exact match for url or it + * is a prefix of url and the match ends on a path component boundary. + * Both url and url_prefix are considered to have an implicit '/' on the
+	 * end for matching purposes if they do not already.

This function should probably be renamed to just url_match_prefix since it isn't part of nor does it depend on the http_options related files or functions anymore.

Otherwise looks good to me.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]