On Thu, Dec 04, 2008 at 05:59:21PM +0000, corvid wrote:
Remember that there's a header ordering convention.
D'oh, I saved the link to the discussion of this and then forget to review it! Will fix.
+/* + * Return the host that contains a URL, or NULL if there is no such host. + */ +static AuthHost *Host_from_url(const DilloUrl *url) +{ + AuthHost *host; + int i; + + for (i = 0; (host = dList_nth_data(auth_hosts, i)); i++) + if (((strcmp(URL_SCHEME(url), host->scheme) == 0) && + (strcmp(URL_AUTHORITY(url), host->authority) == 0))) + return host; + + return NULL; +}
dStrcasecmp
When comparing the scheme, the authority, or both?
+static void Realm_add_path(AuthRealm *realm, const char *path) +{ + int len, i; + char *realm_path; + + len = strlen(path); + /* ignore a trailing '/' */ + if (len && path[len - 1] == '/') + len--; + + /* delete existing paths that are inside the new one */ + for (i = 0; (realm_path = dList_nth_data(realm->paths, i)); i++) { + if (path_is_inside(realm_path, path, len)) { + dList_remove_fast(realm->paths, realm_path); + i--; /* reconsider this slot */ + } + } + + dList_append(realm->paths, dStrndup(path, len)); +}
I think you need a dFree in there.
For the realm_path that gets passed to dList_remove_fast()? Will fix.
PS I took the liberty of adding an entry for Basic auth to Plans.html
No problem. Thanks for looking at this. Jeremy Henty