diff --git a/configure.ac b/configure.ac index 9e55af4..2cf8df1 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/http.c b/http.c index 1643787..4b0fe4e 100644 --- a/http.c +++ b/http.c @@ -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) { diff --git a/rpc_soap.c b/rpc_soap.c index eff460b..48251c3 100755 --- a/rpc_soap.c +++ b/rpc_soap.c @@ -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); diff --git a/xml.c b/xml.c index 01eae67..0aaaa02 100644 --- a/xml.c +++ b/xml.c @@ -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;