From 25e421a5c581277e72d8a114e4153cc80cb3dba10ed86e95e145fc39f5a2e48e Mon Sep 17 00:00:00 2001 From: ADAM David Alan Martin Date: Sat, 10 Jan 2026 12:31:46 -0500 Subject: [PATCH] Auth hosts not a dlist. --- src/auth.cc | 14 +++----------- src/auth.hh | 1 - src/flenser.cc | 1 - 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/auth.cc b/src/auth.cc index 9bf80ab..0200374 100644 --- a/src/auth.cc +++ b/src/auth.cc @@ -51,15 +51,7 @@ typedef struct { /** * Local data */ -static Dlist *auth_hosts; - -/** - * Initialize the auth module. - */ -void a_Auth_init(void) -{ - auth_hosts = dList_new(1); -} +static std::vector< AuthHost_t * > auth_hosts; static AuthParse_t *Auth_parse_new(void) { @@ -359,7 +351,7 @@ static AuthHost_t *Auth_host_by_url(const DilloUrl *url) AuthHost_t *host; 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) && (dStrAsciiCasecmp(URL_AUTHORITY(url), host->authority) == 0))) 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->authority = dStrdup(URL_AUTHORITY(data->url)); host->realms = dList_new(1); - dList_append(auth_hosts, host); + auth_hosts.push_back( host ); } /* find or create the realm */ diff --git a/src/auth.hh b/src/auth.hh index 97a2968..e0c397b 100644 --- a/src/auth.hh +++ b/src/auth.hh @@ -26,5 +26,4 @@ typedef struct { char *a_Auth_get_auth_str(const DilloUrl *url, const char *request_uri); int a_Auth_do_auth(Dlist *auth_string, const DilloUrl *url); -void a_Auth_init(void); diff --git a/src/flenser.cc b/src/flenser.cc index 5353240..eb36d83 100644 --- a/src/flenser.cc +++ b/src/flenser.cc @@ -382,7 +382,6 @@ int main(int argc, char **argv) a_Cookies_init(); a_Actions_init(); a_Hsts_init(Paths::getPrefsFP(PATHS_HSTS_PRELOAD)); - a_Auth_init(); a_UIcmd_init(); StyleEngine::init();