Auth hosts not a dlist.
This commit is contained in:
+3
-11
@@ -51,15 +51,7 @@ typedef struct {
|
|||||||
/**
|
/**
|
||||||
* Local data
|
* Local data
|
||||||
*/
|
*/
|
||||||
static Dlist *auth_hosts;
|
static std::vector< AuthHost_t * > auth_hosts;
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize the auth module.
|
|
||||||
*/
|
|
||||||
void a_Auth_init(void)
|
|
||||||
{
|
|
||||||
auth_hosts = dList_new(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
static AuthParse_t *Auth_parse_new(void)
|
static AuthParse_t *Auth_parse_new(void)
|
||||||
{
|
{
|
||||||
@@ -359,7 +351,7 @@ static AuthHost_t *Auth_host_by_url(const DilloUrl *url)
|
|||||||
AuthHost_t *host;
|
AuthHost_t *host;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; (host = reinterpret_cast< AuthHost_t * >( dList_nth_data(auth_hosts, i) )); i++)
|
for (i = 0; i < auth_hosts.size() and (host = auth_hosts.at( i )); i++)
|
||||||
if (((dStrAsciiCasecmp(URL_SCHEME(url), host->scheme) == 0) &&
|
if (((dStrAsciiCasecmp(URL_SCHEME(url), host->scheme) == 0) &&
|
||||||
(dStrAsciiCasecmp(URL_AUTHORITY(url), host->authority) == 0)))
|
(dStrAsciiCasecmp(URL_AUTHORITY(url), host->authority) == 0)))
|
||||||
return host;
|
return host;
|
||||||
@@ -559,7 +551,7 @@ static void Auth_do_auth_dialog_cb(const char *user, const char *password,
|
|||||||
host->scheme = dStrdup(URL_SCHEME(data->url));
|
host->scheme = dStrdup(URL_SCHEME(data->url));
|
||||||
host->authority = dStrdup(URL_AUTHORITY(data->url));
|
host->authority = dStrdup(URL_AUTHORITY(data->url));
|
||||||
host->realms = dList_new(1);
|
host->realms = dList_new(1);
|
||||||
dList_append(auth_hosts, host);
|
auth_hosts.push_back( host );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find or create the realm */
|
/* find or create the realm */
|
||||||
|
|||||||
@@ -26,5 +26,4 @@ typedef struct {
|
|||||||
|
|
||||||
char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri);
|
char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri);
|
||||||
int a_Auth_do_auth(Dlist *auth_string, const DilloUrl *url);
|
int a_Auth_do_auth(Dlist *auth_string, const DilloUrl *url);
|
||||||
void a_Auth_init(void);
|
|
||||||
|
|
||||||
|
|||||||
@@ -382,7 +382,6 @@ int main(int argc, char **argv)
|
|||||||
a_Cookies_init();
|
a_Cookies_init();
|
||||||
a_Actions_init();
|
a_Actions_init();
|
||||||
a_Hsts_init(Paths::getPrefsFP(PATHS_HSTS_PRELOAD));
|
a_Hsts_init(Paths::getPrefsFP(PATHS_HSTS_PRELOAD));
|
||||||
a_Auth_init();
|
|
||||||
a_UIcmd_init();
|
a_UIcmd_init();
|
||||||
StyleEngine::init();
|
StyleEngine::init();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user