mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 09:36:46 +00:00
FS-2746 --resolve large xmlrpc update thanks garmt
This commit is contained in:
@@ -1,4 +1,24 @@
|
||||
/* A simple standalone XML-RPC server written in C. */
|
||||
/* A simple standalone XML-RPC server program written in C. */
|
||||
|
||||
/* This server knows one RPC class (besides the system classes):
|
||||
"sample.add".
|
||||
|
||||
The program takes one argument: the HTTP port number on which the server
|
||||
is to accept connections, in decimal.
|
||||
|
||||
You can use the example program 'xmlrpc_sample_add_client' to send an RPC
|
||||
to this server.
|
||||
|
||||
Example:
|
||||
|
||||
$ ./xmlrpc_sample_add_server 8080&
|
||||
$ ./xmlrpc_sample_add_client
|
||||
|
||||
For more fun, run client and server in separate terminals and turn on
|
||||
tracing for each:
|
||||
|
||||
$ export XMLRPC_TRACE_XML=1
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -25,8 +45,8 @@
|
||||
static xmlrpc_value *
|
||||
sample_add(xmlrpc_env * const envP,
|
||||
xmlrpc_value * const paramArrayP,
|
||||
void * const serverInfo ATTR_UNUSED,
|
||||
void * const channelInfo ATTR_UNUSED) {
|
||||
void * const serverInfo,
|
||||
void * const channelInfo) {
|
||||
|
||||
xmlrpc_int32 x, y, z;
|
||||
|
||||
@@ -54,6 +74,10 @@ int
|
||||
main(int const argc,
|
||||
const char ** const argv) {
|
||||
|
||||
struct xmlrpc_method_info3 const methodInfo = {
|
||||
/* .methodName = */ "sample.add",
|
||||
/* .methodFunction = */ &sample_add,
|
||||
};
|
||||
xmlrpc_server_abyss_parms serverparm;
|
||||
xmlrpc_registry * registryP;
|
||||
xmlrpc_env env;
|
||||
@@ -70,8 +94,7 @@ main(int const argc,
|
||||
|
||||
registryP = xmlrpc_registry_new(&env);
|
||||
|
||||
xmlrpc_registry_add_method2(
|
||||
&env, registryP, "sample.add", &sample_add, NULL, NULL, NULL);
|
||||
xmlrpc_registry_add_method3(&env, registryP, &methodInfo);
|
||||
|
||||
/* In the modern form of the Abyss API, we supply parameters in memory
|
||||
like a normal API. We select the modern form by setting
|
||||
|
Reference in New Issue
Block a user