1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Modularise HTTP authentication

This commit is contained in:
Miciah Dashiel Butler Masters 2006-05-20 12:49:51 +00:00 committed by Miciah Dashiel Butler Masters
parent 4bb87288f8
commit 337958d4e4
4 changed files with 22 additions and 1 deletions

View File

@ -286,7 +286,6 @@ terminate_all_subsystems(void)
free_marks(); free_marks();
#endif #endif
free_history_lists(); free_history_lists();
free_auth();
done_modules(builtin_modules); done_modules(builtin_modules);
done_screen_drivers(); done_screen_drivers();
done_saved_session_info(); done_saved_session_info();

View File

@ -10,6 +10,7 @@
#include "bfu/hierbox.h" #include "bfu/hierbox.h"
#include "intl/gettext/libintl.h" #include "intl/gettext/libintl.h"
#include "main/module.h"
#include "protocol/auth/auth.h" #include "protocol/auth/auth.h"
#include "protocol/auth/dialogs.h" #include "protocol/auth/dialogs.h"
#include "protocol/protocol.h" #include "protocol/protocol.h"
@ -305,6 +306,12 @@ free_auth(void)
free_list(questions_queue); free_list(questions_queue);
} }
static void
done_auth(struct module *xxx)
{
free_auth();
}
struct auth_entry * struct auth_entry *
get_invalid_auth_entry(void) get_invalid_auth_entry(void)
{ {
@ -320,3 +327,13 @@ get_invalid_auth_entry(void)
return NULL; return NULL;
} }
struct module auth_module = struct_module(
/* name: */ "HTTP Authentication",
/* options: */ NULL,
/* hooks: */ NULL,
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_auth
);

View File

@ -7,6 +7,7 @@
#include "util/lists.h" #include "util/lists.h"
struct listbox_item; struct listbox_item;
struct module;
struct auth_entry { struct auth_entry {
OBJECT_HEAD(struct auth_entry); OBJECT_HEAD(struct auth_entry);
@ -41,4 +42,6 @@ void del_auth_entry(struct auth_entry *);
void free_auth(void); void free_auth(void);
struct auth_entry *get_invalid_auth_entry(void); struct auth_entry *get_invalid_auth_entry(void);
extern struct module auth_module;
#endif #endif

View File

@ -26,6 +26,7 @@
/* Backends dynamic area: */ /* Backends dynamic area: */
#include "protocol/about.h" #include "protocol/about.h"
#include "protocol/auth/auth.h"
#include "protocol/bittorrent/bittorrent.h" #include "protocol/bittorrent/bittorrent.h"
#include "protocol/bittorrent/connection.h" #include "protocol/bittorrent/connection.h"
#include "protocol/data.h" #include "protocol/data.h"
@ -273,6 +274,7 @@ static struct option_info protocol_options[] = {
NULL_OPTION_INFO, NULL_OPTION_INFO,
}; };
static struct module *protocol_submodules[] = { static struct module *protocol_submodules[] = {
&auth_module,
#ifdef CONFIG_BITTORRENT #ifdef CONFIG_BITTORRENT
&bittorrent_protocol_module, &bittorrent_protocol_module,
#endif #endif