1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-06-28 01:35:32 +00:00

Introduced CGI module

This commit is contained in:
2006-01-30 08:56:40 +01:00
parent 207922b371
commit aed26bf002
4 changed files with 30 additions and 14 deletions

View File

@ -35,6 +35,30 @@
#include "util/env.h"
#include "util/string.h"
static struct option_info cgi_options[] = {
INIT_OPT_TREE("protocol.file", N_("Local CGI"),
"cgi", 0,
N_("Local CGI specific options.")),
INIT_OPT_STRING("protocol.file.cgi", N_("Path"),
"path", 0, "",
N_("Colon separated list of directories, where CGI scripts are stored.")),
INIT_OPT_BOOL("protocol.file.cgi", N_("Allow local CGI"),
"policy", 0, 0,
N_("Whether to execute local CGI scripts.")),
NULL_OPTION_INFO,
};
struct module cgi_protocol_module = struct_module(
/* name: */ N_("CGI"),
/* options: */ cgi_options,
/* hooks: */ NULL,
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ NULL
);
static void
close_pipe_and_read(struct socket *data_socket)

View File

@ -3,7 +3,9 @@
#define EL__PROTOCOL_FILE_CGI_H
struct connection;
struct module;
extern struct module cgi_protocol_module;
int execute_cgi(struct connection *);
#endif

View File

@ -39,20 +39,6 @@ static struct option_info file_options[] = {
"file", 0,
N_("Options specific to local browsing.")),
#ifdef CONFIG_CGI
INIT_OPT_TREE("protocol.file", N_("Local CGI"),
"cgi", 0,
N_("Local CGI specific options.")),
INIT_OPT_STRING("protocol.file.cgi", N_("Path"),
"path", 0, "",
N_("Colon separated list of directories, where CGI scripts are stored.")),
INIT_OPT_BOOL("protocol.file.cgi", N_("Allow local CGI"),
"policy", 0, 0,
N_("Whether to execute local CGI scripts.")),
#endif /* CONFIG_CGI */
INIT_OPT_BOOL("protocol.file", N_("Allow reading special files"),
"allow_special_files", 0, 0,
N_("Whether to allow reading from non-regular files.\n"

View File

@ -29,6 +29,7 @@
#include "protocol/bittorrent/bittorrent.h"
#include "protocol/bittorrent/connection.h"
#include "protocol/data.h"
#include "protocol/file/cgi.h"
#include "protocol/file/file.h"
#include "protocol/finger/finger.h"
#include "protocol/fsp/fsp.h"
@ -275,6 +276,9 @@ static struct module *protocol_submodules[] = {
&bittorrent_protocol_module,
#endif
&file_protocol_module,
#ifdef CONFIG_CGI
&cgi_protocol_module,
#endif
#ifdef CONFIG_FINGER
&finger_protocol_module,
#endif