diff --git a/src/main/main.c b/src/main/main.c index 22a2861e..5c38251b 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -286,7 +286,6 @@ terminate_all_subsystems(void) free_marks(); #endif free_history_lists(); - free_auth(); done_modules(builtin_modules); done_screen_drivers(); done_saved_session_info(); diff --git a/src/protocol/auth/auth.c b/src/protocol/auth/auth.c index 6b7f30eb..0788036d 100644 --- a/src/protocol/auth/auth.c +++ b/src/protocol/auth/auth.c @@ -10,6 +10,7 @@ #include "bfu/hierbox.h" #include "intl/gettext/libintl.h" +#include "main/module.h" #include "protocol/auth/auth.h" #include "protocol/auth/dialogs.h" #include "protocol/protocol.h" @@ -305,6 +306,12 @@ free_auth(void) free_list(questions_queue); } +static void +done_auth(struct module *xxx) +{ + free_auth(); +} + struct auth_entry * get_invalid_auth_entry(void) { @@ -320,3 +327,13 @@ get_invalid_auth_entry(void) return NULL; } + +struct module auth_module = struct_module( + /* name: */ "HTTP Authentication", + /* options: */ NULL, + /* hooks: */ NULL, + /* submodules: */ NULL, + /* data: */ NULL, + /* init: */ NULL, + /* done: */ done_auth +); diff --git a/src/protocol/auth/auth.h b/src/protocol/auth/auth.h index 386c3de8..ea4c5e88 100644 --- a/src/protocol/auth/auth.h +++ b/src/protocol/auth/auth.h @@ -7,6 +7,7 @@ #include "util/lists.h" struct listbox_item; +struct module; struct auth_entry { OBJECT_HEAD(struct auth_entry); @@ -41,4 +42,6 @@ void del_auth_entry(struct auth_entry *); void free_auth(void); struct auth_entry *get_invalid_auth_entry(void); +extern struct module auth_module; + #endif diff --git a/src/protocol/protocol.c b/src/protocol/protocol.c index fe2d060c..3ffca54c 100644 --- a/src/protocol/protocol.c +++ b/src/protocol/protocol.c @@ -26,6 +26,7 @@ /* Backends dynamic area: */ #include "protocol/about.h" +#include "protocol/auth/auth.h" #include "protocol/bittorrent/bittorrent.h" #include "protocol/bittorrent/connection.h" #include "protocol/data.h" @@ -273,6 +274,7 @@ static struct option_info protocol_options[] = { NULL_OPTION_INFO, }; static struct module *protocol_submodules[] = { + &auth_module, #ifdef CONFIG_BITTORRENT &bittorrent_protocol_module, #endif