diff options
Diffstat (limited to 'src/libgit2/netops.c')
-rw-r--r-- | src/libgit2/netops.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/libgit2/netops.c b/src/libgit2/netops.c index 00640c600..5cae374ad 100644 --- a/src/libgit2/netops.c +++ b/src/libgit2/netops.c @@ -83,42 +83,3 @@ void gitno_consume_n(gitno_buffer *buf, size_t cons) memset(buf->data + cons, 0x0, buf->len - buf->offset); buf->offset -= cons; } - -/* Match host names according to RFC 2818 rules */ -int gitno__match_host(const char *pattern, const char *host) -{ - for (;;) { - char c = git__tolower(*pattern++); - - if (c == '\0') - return *host ? -1 : 0; - - if (c == '*') { - c = *pattern; - /* '*' at the end matches everything left */ - if (c == '\0') - return 0; - - /* - * We've found a pattern, so move towards the next matching - * char. The '.' is handled specially because wildcards aren't - * allowed to cross subdomains. - */ - - while(*host) { - char h = git__tolower(*host); - if (c == h) - return gitno__match_host(pattern, host++); - if (h == '.') - return gitno__match_host(pattern, host); - host++; - } - return -1; - } - - if (c != git__tolower(*host++)) - return -1; - } - - return -1; -} |