Skip to content
Snippets Groups Projects
Commit 60c47c23 authored by rswindell's avatar rswindell
Browse files

Added web server configuration settings to .ini file format.

parent 8c535638
Branches
Tags
No related merge requests found
...@@ -44,6 +44,22 @@ static ini_bitdesc_t ftp_options[] = { ...@@ -44,6 +44,22 @@ static ini_bitdesc_t ftp_options[] = {
{ -1 ,NULL } { -1 ,NULL }
}; };
static ini_bitdesc_t web_options[] = {
{ WEB_OPT_DEBUG_TX ,"DEBUG_TX" },
/* shared bits */
{ BBS_OPT_NO_HOST_LOOKUP ,"NO_HOST_LOOKUP" },
{ BBS_OPT_NO_RECYCLE ,"NO_RECYCLE" },
{ BBS_OPT_GET_IDENT ,"GET_IDENT" },
{ BBS_OPT_NO_JAVASCRIPT ,"NO_JAVASCRIPT" },
{ BBS_OPT_LOCAL_TIMEZONE ,"LOCAL_TIMEZONE" },
{ BBS_OPT_MUTE ,"MUTE" },
/* terminator */
{ -1 ,NULL }
};
static ini_bitdesc_t mail_options[] = { static ini_bitdesc_t mail_options[] = {
{ MAIL_OPT_DEBUG_RX_HEADER ,"DEBUG_RX_HEADER" }, { MAIL_OPT_DEBUG_RX_HEADER ,"DEBUG_RX_HEADER" },
...@@ -85,6 +101,8 @@ void sbbs_read_ini( ...@@ -85,6 +101,8 @@ void sbbs_read_ini(
,bbs_startup_t* bbs ,bbs_startup_t* bbs
,BOOL* run_ftp ,BOOL* run_ftp
,ftp_startup_t* ftp ,ftp_startup_t* ftp
,BOOL* run_web
,web_startup_t* web
,BOOL* run_mail ,BOOL* run_mail
,mail_startup_t* mail ,mail_startup_t* mail
,BOOL* run_services ,BOOL* run_services
...@@ -277,4 +295,26 @@ void sbbs_read_ini( ...@@ -277,4 +295,26 @@ void sbbs_read_ini(
=iniReadBitField(fp,section,"Options",service_options =iniReadBitField(fp,section,"Options",service_options
,BBS_OPT_NO_HOST_LOOKUP); ,BBS_OPT_NO_HOST_LOOKUP);
/***********************************************************************/
section = "Web";
*run_web
=iniReadBool(fp,section,"AutoStart",TRUE);
web->interface_addr
=iniReadIpAddress(fp,section,"Interface",INADDR_ANY);
web->port
=iniReadShortInt(fp,section,"Port",IPPORT_HTTP);
SAFECOPY(web->host_name
,iniReadString(fp,section,"HostName",host_name));
SAFECOPY(web->root_dir
,iniReadString(fp,section,"RootDirectory","../html"));
SAFECOPY(web->error_dir
,iniReadString(fp,section,"ErrorDirectory","../html/error"));
web->options
=iniReadBitField(fp,section,"Options",web_options
,BBS_OPT_NO_HOST_LOOKUP);
} }
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "ftpsrvr.h" /* ftp_startup_t */ #include "ftpsrvr.h" /* ftp_startup_t */
#include "mailsrvr.h" /* mail_startup_t */ #include "mailsrvr.h" /* mail_startup_t */
#include "services.h" /* services_startup_t */ #include "services.h" /* services_startup_t */
#include "websrvr.h" /* services_startup_t */
#include "ini_file.h" #include "ini_file.h"
#if defined(__cplusplus) #if defined(__cplusplus)
...@@ -19,6 +20,8 @@ void sbbs_read_ini( ...@@ -19,6 +20,8 @@ void sbbs_read_ini(
,bbs_startup_t* bbs_startup ,bbs_startup_t* bbs_startup
,BOOL* run_ftp ,BOOL* run_ftp
,ftp_startup_t* ftp_startup ,ftp_startup_t* ftp_startup
,BOOL* run_web
,web_startup_t* web_startup
,BOOL* run_mail ,BOOL* run_mail
,mail_startup_t* mail_startup ,mail_startup_t* mail_startup
,BOOL* run_services ,BOOL* run_services
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment