static int yy_defer_accept = 1;
struct TopConf *conf_cur_block;
-static char *conf_cur_block_name;
+static char *conf_cur_block_name = NULL;
static rb_dlink_list conf_items;
static const char *
conf_strtype(int type)
{
- switch (type & CF_MTYPE)
+ switch (CF_TYPE(type))
{
case CF_INT:
return "integer value";
}
int
-add_top_conf(const char *name, int (*sfunc) (struct TopConf *),
+add_top_conf(const char *name, int (*sfunc) (struct TopConf *),
int (*efunc) (struct TopConf *), struct ConfEntry *items)
{
struct TopConf *tc;
int dir = 1;
int mode;
- if((args->type & CF_MTYPE) != CF_STRING)
+ if(CF_TYPE(args->type) != CF_STRING)
{
conf_report_error("Warning -- %s is not a string; ignoring.", whatis);
continue;
yy_tmpoper->name);
return 0;
}
-
+
yy_tmpoper->rsa_pubkey =
(RSA *) PEM_read_bio_RSA_PUBKEY(file, NULL, 0, NULL);
conf_parm_t *args = data;
for (; args; args = args->next)
{
- if((args->type & CF_MTYPE) != CF_INT)
+ if(CF_TYPE(args->type) != CF_INT)
{
conf_report_error
("listener::port argument is not an integer " "-- ignoring.");
#ifdef RB_IPV6
if(strchr(listener_address, ':') != NULL)
family = AF_INET6;
- else
+ else
#endif
family = AF_INET;
-
+
add_listener(args->v.number, listener_address, family, ssl, yy_defer_accept);
-
+
}
}
if(yy_aconf->spasswd)
yy_tmp->spasswd = rb_strdup(yy_aconf->spasswd);
-
+
/* this will always exist.. */
yy_tmp->info.name = rb_strdup(yy_aconf->info.name);
if(args->next != NULL)
{
- if((args->type & CF_MTYPE) != CF_QSTRING)
+ if(CF_TYPE(args->type) != CF_QSTRING)
{
conf_report_error("Ignoring shared::oper -- server is not a qstring");
return;
else
yy_shared->server = rb_strdup("*");
- if((args->type & CF_MTYPE) != CF_QSTRING)
+ if(CF_TYPE(args->type) != CF_QSTRING)
{
conf_report_error("Ignoring shared::oper -- oper is not a qstring");
return;
}
break;
}
- }
+ }
}
static void
int
conf_end_block(struct TopConf *tc)
{
+ int ret = 0;
if(tc->tc_efunc)
- return tc->tc_efunc(tc);
+ ret = tc->tc_efunc(tc);
rb_free(conf_cur_block_name);
- return 0;
+ conf_cur_block_name = NULL;
+ return ret;
}
static void
}
int
-conf_call_set(struct TopConf *tc, char *item, conf_parm_t * value, int type)
+conf_call_set(struct TopConf *tc, char *item, conf_parm_t * value)
{
struct ConfEntry *cf;
conf_parm_t *cp;
if(CF_TYPE(value->v.list->type) != CF_TYPE(cf->cf_type))
{
- /* if it expects a string value, but we got a yesno,
+ /* if it expects a string value, but we got a yesno,
* convert it back
*/
if((CF_TYPE(value->v.list->type) == CF_YESNO) &&
{ "ssl_private_key", CF_QSTRING, NULL, 0, &ServerInfo.ssl_private_key },
{ "ssl_ca_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_ca_cert },
- { "ssl_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_cert },
+ { "ssl_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_cert },
{ "ssl_dh_params", CF_QSTRING, NULL, 0, &ServerInfo.ssl_dh_params },
{ "ssld_count", CF_INT, NULL, 0, &ServerInfo.ssld_count },
add_top_conf("auth", conf_begin_auth, conf_end_auth, conf_auth_table);
add_top_conf("shared", conf_cleanup_shared, conf_cleanup_shared, NULL);
- add_conf_item("shared", "oper", CF_QSTRING|CF_FLIST, conf_set_shared_oper);
+ add_conf_item("shared", "oper", CF_QSTRING | CF_FLIST, conf_set_shared_oper);
add_conf_item("shared", "flags", CF_STRING | CF_FLIST, conf_set_shared_flags);
add_top_conf("connect", conf_begin_connect, conf_end_connect, conf_connect_table);