Revert DUMMY_MODE macro

This commit is contained in:
Omar Kallel 2021-11-22 15:40:09 +01:00
parent 4bef706ddf
commit d485fc0eef
4 changed files with 3 additions and 19 deletions

View file

@ -18,7 +18,6 @@ AS_IF([test "x$enable_acs" = "xno"], [AC_DEFINE(ACS_MULTI)])
AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [enable debugging messages])], AC_DEFINE(WITH_CWMP_DEBUG),)
AC_ARG_ENABLE(devel, [AS_HELP_STRING([--enable-devel], [enable development messages])], AC_DEFINE(WITH_DEV_DEBUG),)
AC_ARG_ENABLE(dummy_mode, [AS_HELP_STRING([--enable-dummy-mode], [enable dummy mode])], AC_DEFINE(DUMMY_MODE),)
# checks for programs
AC_PROG_CC

4
http.c
View file

@ -33,11 +33,7 @@ static struct http_client http_c;
static CURL *curl = NULL;
#ifdef DUMMY_MODE
char *fc_cookies = "./ext/tmp/icwmp_cookies";
#else
char *fc_cookies = "/tmp/icwmp_cookies";
#endif
void http_set_timeout(void)
{

View file

@ -262,14 +262,8 @@ int cwmp_rpc_acs_prepare_message_inform(struct cwmp *cwmp, struct session *sessi
if (session == NULL || this == NULL)
return -1;
#ifdef DUMMY_MODE
FILE *fp;
fp = fopen("./ext/soap_msg_templates/cwmp_inform_message.xml", "r");
tree = mxmlLoadFile(NULL, fp, MXML_OPAQUE_CALLBACK);
fclose(fp);
#else
tree = mxmlLoadString(NULL, CWMP_INFORM_MESSAGE, MXML_OPAQUE_CALLBACK);
#endif
if (!tree)
goto error;
b = mxmlFindElement(tree, tree, "soap_env:Envelope", NULL, NULL, MXML_DESCEND);

9
xml.c
View file

@ -211,20 +211,15 @@ int xml_prepare_msg_out(struct session *session)
struct cwmp *cwmp = &cwmp_main;
struct config *conf;
conf = &(cwmp->conf);
#ifdef DUMMY_MODE
FILE *fp;
fp = fopen("./ext/soap_msg_templates/cwmp_response_message.xml", "r");
session->tree_out = mxmlLoadFile(NULL, fp, MXML_OPAQUE_CALLBACK);
fclose(fp);
#else
mxml_node_t *n;
session->tree_out = mxmlLoadString(NULL, CWMP_RESPONSE_MESSAGE, MXML_OPAQUE_CALLBACK);
n = mxmlFindElement(session->tree_out, session->tree_out, "soap_env:Envelope", NULL, NULL, MXML_DESCEND);
if (!n) {
return -1;
}
mxmlElementSetAttr(n, "xmlns:cwmp", cwmp_urls[(conf->amd_version) - 1]);
#endif
if (!session->tree_out)
return -1;