Improve the algorithm for URL look up in wickets.
The new algorithm always returns the best match, i.e. the one with the smallest number of wildcard comparisons. * include/mailutils/auth.h (mu_wicket_stream_match_url) (mu_wicket_file_match_url): New protos. Remove unnecessary 'extern' qualifiers. * include/mailutils/url.h (mu_url_is_ticket): Remove. (mu_url_matches_ticket): New proto. * libmailutils/base/url.c (mu_url_parse): Fix name corruption during password obfuscation. (defined): Remove static function. (mu_url_is_ticket): Remove function. (mu_url_matches_ticket): New function. * libmailutils/base/wicket.c (get_ticket_url): Remove. (mu_wicket_stream_match_url) (mu_wicket_file_match_url): New functions. (file_ticket_get_cred): Use mu_wicket_file_match_url. * libmailutils/tests/wicket.c: New file. * libmailutils/tests/Wicketfile: New file. * libmailutils/tests/wicket.at: New file. * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add wicket. (EXTRA_DIST): Add Wicketfile (TESTSUITE_AT): Add wicket.at * libmailutils/tests/testsuite.at: Include wicket.at * libmailutils/tests/.gitignore: Update.
Showing
10 changed files
with
336 additions
and
114 deletions
libmailutils/tests/Wicketfile
0 → 100644
libmailutils/tests/wicket.at
0 → 100644
libmailutils/tests/wicket.c
0 → 100644
-
Please register or sign in to post a comment