mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-13 21:17:06 +00:00
FS-2746 --resolve large xmlrpc update thanks garmt
This commit is contained in:
1 parent
37ecad9903
commit
6b6c83a718
397 files changed
+41821
-33840
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include "unistdx.h"
|
||||
#include <stdio.h>
|
||||
#include "bool.h"
|
||||
|
||||
#include "xmlrpc_config.h"
|
||||
|
||||
@@ -8,16 +9,32 @@
|
||||
#include "xmlrpc-c/abyss.h"
|
||||
#include "xmlrpc-c/server_abyss.h"
|
||||
|
||||
#include "test.h"
|
||||
#include "testtool.h"
|
||||
|
||||
#include "server_abyss.h"
|
||||
|
||||
|
||||
static xmlrpc_call_processor myXmlProcessor;
|
||||
|
||||
static void
|
||||
myXmlProcessor(xmlrpc_env * const envP ATTR_UNUSED,
|
||||
void * const processorArg ATTR_UNUSED,
|
||||
const char * const callXml ATTR_UNUSED,
|
||||
size_t const callXmlLen ATTR_UNUSED,
|
||||
TSession * const abyssSessionP ATTR_UNUSED,
|
||||
xmlrpc_mem_block ** const responseXmlPP ATTR_UNUSED) {
|
||||
|
||||
printf("XML processor running\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
testSetHandlers(TServer * const abyssServerP) {
|
||||
|
||||
xmlrpc_env env;
|
||||
xmlrpc_registry * registryP;
|
||||
xmlrpc_server_abyss_handler_parms parms;
|
||||
|
||||
xmlrpc_env_init(&env);
|
||||
|
||||
@@ -25,11 +42,32 @@ testSetHandlers(TServer * const abyssServerP) {
|
||||
TEST_NO_FAULT(&env);
|
||||
TEST(registryP != NULL);
|
||||
|
||||
parms.xml_processor = &myXmlProcessor;
|
||||
parms.xml_processor_arg = NULL;
|
||||
parms.xml_processor_max_stack = 512;
|
||||
parms.uri_path = "/RPC6";
|
||||
parms.chunk_response = true;
|
||||
parms.allow_origin = "*";
|
||||
|
||||
xmlrpc_server_abyss_set_handler3(
|
||||
&env, abyssServerP, &parms, XMLRPC_AHPSIZE(xml_processor_arg));
|
||||
TEST_FAULT(&env, XMLRPC_INTERNAL_ERROR); /* Parms too short */
|
||||
xmlrpc_server_abyss_set_handler3(
|
||||
&env, abyssServerP, &parms, XMLRPC_AHPSIZE(allow_origin));
|
||||
TEST_NO_FAULT(&env);
|
||||
|
||||
xmlrpc_server_abyss_set_handler2(abyssServerP, "/RPC5",
|
||||
&myXmlProcessor, NULL, 512, true);
|
||||
|
||||
xmlrpc_server_abyss_set_handler(&env, abyssServerP, "/RPC3", registryP);
|
||||
TEST_NO_FAULT(&env);
|
||||
|
||||
xmlrpc_server_abyss_set_handlers2(abyssServerP, "/RPC4", registryP);
|
||||
|
||||
xmlrpc_server_abyss_set_handlers(abyssServerP, registryP);
|
||||
|
||||
xmlrpc_server_abyss_set_default_handler(abyssServerP);
|
||||
|
||||
xmlrpc_registry_free(registryP);
|
||||
|
||||
{
|
||||
@@ -57,6 +95,7 @@ testServerParms(void) {
|
||||
parms.dont_advertise = TRUE;
|
||||
parms.uri_path = "/RPC9";
|
||||
parms.chunk_response = TRUE;
|
||||
parms.allow_origin = "*";
|
||||
};
|
||||
|
||||
|
||||
@@ -108,6 +147,8 @@ testObject(void) {
|
||||
xmlrpc_server_abyss_restore_sig(oldHandlersP);
|
||||
TEST_NO_FAULT(&env);
|
||||
|
||||
free(oldHandlersP);
|
||||
|
||||
xmlrpc_server_abyss_destroy(serverP);
|
||||
|
||||
xmlrpc_registry_free(registryP);
|
||||
|
||||
Reference in new issue
Block a user