diff --git a/src/conf.c b/src/conf.c index 079c5c5f..6716e18c 100644 --- a/src/conf.c +++ b/src/conf.c @@ -864,7 +864,7 @@ int conf_set_string(char *section, char *key, char *value) { } _conf_dispose_split(valuearray); } - } else { + } else { if((err = ll_add_string(section_ll,key,value)) != LL_E_SUCCESS) { DPRINTF(E_LOG,L_CONF,"Error in conf_set_string: " "(%s/%s)\n",section,key); @@ -1260,7 +1260,7 @@ void conf_dispose_array(char **argv) { /** * dump the config to xml - * + * * @param pwsc web connection to dump to * @returns TRUE on success, FALSE otherwise */ @@ -1337,3 +1337,12 @@ int _conf_xml_dump(XMLSTRUCT *pxml, LL *pll, int sublevel, char *parent) { return TRUE; } + +/** + * get the filename of the currently runnig config file + * + * @returns path if it exists, or NULL if no config file opened + */ +char *conf_get_filename(void) { + return conf_main_file; +} diff --git a/src/conf.h b/src/conf.h index 9f5c0b3e..2ab25af9 100644 --- a/src/conf.h +++ b/src/conf.h @@ -49,6 +49,8 @@ extern char *conf_implode(char *section, char *key, char *delimiter); extern int conf_get_array(char *section, char *key, char ***argvp); extern void conf_dispose_array(char **argv); +extern char *conf_get_filename(void); + /* FIXME: get enum functions and move to xml-rpc */ #include "webserver.h" extern int conf_xml_dump(WS_CONNINFO *pwsc); diff --git a/src/xml-rpc.c b/src/xml-rpc.c index 1d924b9f..a435dcd0 100644 --- a/src/xml-rpc.c +++ b/src/xml-rpc.c @@ -47,7 +47,7 @@ void xml_return_error(WS_CONNINFO *pwsc, int errno, char *errstr) { pxml=xml_init(pwsc,TRUE); xml_push(pxml,"results"); - + xml_output(pxml,"status","%d",errno); xml_output(pxml,"statusstring","%s",errstr); @@ -353,6 +353,8 @@ void xml_get_stats(WS_CONNINFO *pwsc) { xml_push(pxml,"misc"); xml_output(pxml,"writable_config","%d",conf_iswritable()); + xml_output(pxml,"config_path","%s",conf_get_filename()); + xml_output(pxml,"version","%s",VERSION); xml_pop(pxml); /* misc */ xml_pop(pxml); /* status */