mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 13:28:31 +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 +0,0 @@
|
||||
Makefile
|
||||
@@ -7,15 +7,20 @@ SUBDIR := tools
|
||||
|
||||
include $(BLDDIR)/config.mk
|
||||
|
||||
SUBDIRS = binmode-rpc-kit turbocharger
|
||||
SUBDIRS = \
|
||||
binmode-rpc-kit \
|
||||
lib \
|
||||
turbocharger \
|
||||
|
||||
ifeq ($(MUST_BUILD_CLIENT),yes)
|
||||
SUBDIRS += xmlrpc xmlrpc_transport
|
||||
|
||||
ifeq ($(ENABLE_CPLUSPLUS),yes)
|
||||
SUBDIRS += xml-rpc-api2cpp xmlrpc_cpp_proxy
|
||||
# We could add 'xmlrpc_pstream' here, but we don't because we don't
|
||||
# want to deal with finding the Readline/Ncurses libraries.
|
||||
SUBDIRS += xml-rpc-api2cpp xml-rpc-api2txt xmlrpc_cpp_proxy
|
||||
|
||||
ifeq ($(BUILD_XMLRPC_PSTREAM),yes)
|
||||
SUBDIRS += xmlrpc_pstream
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
# -*-makefile-*- <-- an Emacs control
|
||||
|
||||
CLIENT_LDFLAGS =
|
||||
ifeq ($(MUST_BUILD_LIBWWW_CLIENT),yes)
|
||||
CLIENT_LDFLAGS += $(shell libwww-config --libs)
|
||||
endif
|
||||
ifeq ($(MUST_BUILD_CURL_CLIENT),yes)
|
||||
CLIENT_LDFLAGS += $(shell curl-config --libs) -lpthread
|
||||
endif
|
||||
ifeq ($(MUST_BUILD_WININET_CLIENT),yes)
|
||||
CLIENT_LDFLAGS += $(shell wininet-config --libs)
|
||||
endif
|
||||
|
||||
LIBEXPAT = $(BUILDDIR)/lib/expat/xmlparse/libxmlrpc_xmlparse.la \
|
||||
$(BUILDDIR)/lib/expat/xmltok/libxmlrpc_xmltok.la
|
||||
|
||||
ifeq ($(ENABLE_LIBXML2_BACKEND),yes)
|
||||
LIBXML = $(LIBXML2_LIBS)
|
||||
else
|
||||
LIBXML = $(LIBEXPAT)
|
||||
endif
|
||||
|
||||
LIBXMLRPC = $(BUILDDIR)/src/libxmlrpc.la
|
||||
LIBXMLRPC_CPP = $(BUILDDIR)/src/cpp/libxmlrpc_cpp.a
|
||||
LIBXMLRPC_CLIENT = $(BUILDDIR)/src/libxmlrpc_client.la
|
||||
LIBXMLRPC_SERVER = $(BUILDDIR)/src/libxmlrpc_server.la
|
||||
|
||||
XMLRPC_LIBS = $(LIBXMLRPC) $(LIBXMLRPC_CPP) $(LIBXMLRPC_CLIENT) \
|
||||
$(LIBXMLRPC_SERVER) $(LIBXML)
|
||||
|
||||
UTIL_DIR = $(BUILDDIR)/lib/util
|
||||
|
||||
BUILDABLE_UTILS = casprintf.o cmdline_parser.o getoptx.o
|
||||
|
||||
$(BUILDABLE_UTILS:%=$(UTIL_DIR)/%): FORCE
|
||||
$(MAKE) -C $(dir $@) $(notdir $@)
|
||||
|
||||
include $(SRCDIR)/Makefile.common
|
||||
|
||||
.PHONY: install
|
||||
install: install-common
|
||||
|
||||
.PHONY: check
|
||||
check:
|
||||
|
||||
.PHONY: FORCE
|
||||
FORCE:
|
||||
@@ -29,7 +29,7 @@ CLIENTPP_LDLIBS += -lxmlrpc_client++ -lxmlrpc_packetsocket -lxmlrpc++
|
||||
include $(SRCDIR)/common.mk
|
||||
|
||||
ifneq ($(OMIT_LIB_RULE),Y)
|
||||
srcdir/tools/lib/dumpvalue.o: FORCE
|
||||
blddir/tools/lib/dumpvalue.o: FORCE
|
||||
$(MAKE) -C $(dir $@) -f $(SRCDIR)/tools/lib/Makefile $(notdir $@)
|
||||
endif
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ INCLUDES = \
|
||||
-Isrcdir/include \
|
||||
-Isrcdir/lib/util/include \
|
||||
|
||||
CFLAGS = $(CFLAGS_COMMON) $(INCLUDES) $(CFLAGS_PERSONAL) $(CADD)
|
||||
|
||||
LIBOBJS = \
|
||||
dumpvalue.o \
|
||||
|
||||
@@ -29,14 +27,14 @@ LIBOBJS = \
|
||||
all: $(LIBOBJS)
|
||||
|
||||
%.o:%.c
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
$(CC) -c $(CFLAGS_ALL) $<
|
||||
|
||||
# This common.mk dependency makes sure the symlinks get built before
|
||||
# this make file is used for anything.
|
||||
|
||||
$(SRCDIR)/tool/common.mk: srcdir blddir
|
||||
$(SRCDIR)/tools/common.mk: srcdir blddir
|
||||
|
||||
include Makefile.depend
|
||||
include depend.mk
|
||||
|
||||
.PHONY: dep
|
||||
dep: dep-common
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
used for debugging purposes in other places.
|
||||
*/
|
||||
|
||||
//#define _GNU_SOURCE
|
||||
#define _XOPEN_SOURCE 600 /* Make sure strdup() is in <string.h> */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -297,12 +297,12 @@ dumpStructMember(const char * const prefix,
|
||||
const char * prefix2;
|
||||
const char * blankPrefix;
|
||||
|
||||
casprintf(&prefix2, "%s Key: ", prefix);
|
||||
casprintf(&blankPrefix, "%*s", blankCount, "");
|
||||
|
||||
casprintf(&prefix2, "%s Key: ", blankPrefix);
|
||||
dumpValue(prefix2, keyP);
|
||||
strfree(prefix2);
|
||||
|
||||
casprintf(&blankPrefix, "%*s", blankCount, "");
|
||||
|
||||
casprintf(&prefix2, "%s Value: ", blankPrefix);
|
||||
dumpValue(prefix2, valueP);
|
||||
strfree(prefix2);
|
||||
@@ -407,13 +407,13 @@ dumpI8(const char * const prefix,
|
||||
xmlrpc_env_init(&env);
|
||||
|
||||
xmlrpc_read_i8(&env, valueP, &value);
|
||||
|
||||
|
||||
if (env.fault_occurred)
|
||||
printf("Internal error: unable to extract value of "
|
||||
"64-bit integer xmlrpc_value %lx. %s\n",
|
||||
(unsigned long)valueP, env.fault_string);
|
||||
else
|
||||
printf("%s64-bit integer: %" PRId64 "\n", prefix, value);
|
||||
printf("%s64-bit integer: %" XMLRPC_PRId64 "\n", prefix, value);
|
||||
|
||||
xmlrpc_env_clean(&env);
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
Makefile
|
||||
@@ -1 +0,0 @@
|
||||
xml-rpc-api2cpp
|
||||
@@ -10,23 +10,24 @@ default: all
|
||||
|
||||
include $(BLDDIR)/config.mk
|
||||
|
||||
PROGS := xml-rpc-api2cpp
|
||||
PROGRAMS_TO_INSTALL := $(PROGS)
|
||||
MAN_FILES_TO_INSTALL := xml-rpc-api2cpp.1
|
||||
|
||||
all: $(PROGS)
|
||||
|
||||
include $(SRCDIR)/tools/common.mk
|
||||
|
||||
INCLUDES = -I$(BLDDIR) -I$(BLDDIR)/include -I$(SRCDIR)/include
|
||||
# <sstream.h> in Glibc 2.2 has a bug that results in inlining failure,
|
||||
# so we disable warnings for that:
|
||||
CFLAGS_LOCAL = -Wno-inline
|
||||
|
||||
CXXFLAGS = $(INCLUDES) $(CXXFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
|
||||
INCLUDES = -I$(BLDDIR) -I$(BLDDIR)/include -Isrcdir/include
|
||||
|
||||
LDFLAGS = $(LADD)
|
||||
|
||||
LDLIBS = -L$(BLDDIR)/src/cpp -lxmlrpc_cpp -lxmlrpc_server $(CLIENT_LDLIBS)
|
||||
|
||||
PROGS :=
|
||||
|
||||
ifeq ($(MUST_BUILD_CLIENT),yes)
|
||||
PROGS += xml-rpc-api2cpp
|
||||
endif
|
||||
|
||||
all: $(PROGS)
|
||||
LDLIBS = -L$(BLDDIR)/src/cpp -lxmlrpc_cpp -L$(BLDDIR)/src -lxmlrpc_server \
|
||||
$(CLIENT_LDLIBS)
|
||||
|
||||
OBJECTS = \
|
||||
xml-rpc-api2cpp.o \
|
||||
@@ -46,14 +47,14 @@ xml-rpc-api2cpp: \
|
||||
$(CXXLD) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS)
|
||||
|
||||
%.o:%.cpp
|
||||
$(CXX) -c $(CXXFLAGS) $<
|
||||
$(CXX) -c $(CXXFLAGS_ALL) $<
|
||||
|
||||
# This common.mk dependency makes sure the symlinks get built before
|
||||
# this make file is used for anything.
|
||||
|
||||
$(SRCDIR)/common.mk: srcdir blddir
|
||||
$(SRCDIR)/tools/common.mk: srcdir blddir
|
||||
|
||||
include Makefile.depend
|
||||
include depend.mk
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-common
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
This program generates C++ wrapper classes for XML-RPC servers. It talks
|
||||
to xmlrpc-c and XML-RPC.NET servers without any problems, but tends to
|
||||
choke when talking to mod_php-based servers. It looks like there is some
|
||||
kind of pipelining problem.
|
||||
|
||||
This code is an ongoing project. Please send feedback!
|
||||
@@ -1,147 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# A handy little program to get the documentation of the available
|
||||
# methods from an XML-RPC service (via XML-RPC Introspection) and
|
||||
# print it out nicely formatted.
|
||||
#
|
||||
# (I wrote this in Perl because of all the spiffy report-generation
|
||||
# features.)
|
||||
#
|
||||
# You'll need to get Ken MacLeod's Frontier::RPC2 module from CPAN to use
|
||||
# this.
|
||||
#
|
||||
# Eric Kidd <eric.kidd@pobox.com>
|
||||
#
|
||||
# This script is part of xmlrpc-c, and may be used and distributed under
|
||||
# the same terms as the rest of the package.
|
||||
|
||||
use strict;
|
||||
|
||||
# One global variable for use with Perl's format routines, and one for
|
||||
# use inside an 'exec' block.
|
||||
use vars qw/$helptext $method_list/;
|
||||
|
||||
# Try to load our Perl XML-RPC bindings, but fail gracefully.
|
||||
eval {
|
||||
require Frontier::Client;
|
||||
};
|
||||
if ($@) {
|
||||
print STDERR <<"EOD";
|
||||
This script requires Ken MacLeod\'s Frontier::RPC2 module. You can get this
|
||||
from CPAN or from his website at http://bitsko.slc.ut.us/~ken/xml-rpc/ .
|
||||
|
||||
For installation instructions, see the XML-RPC HOWTO at:
|
||||
http://www.linuxdoc.org/HOWTO/XML-RPC-HOWTO/index.html
|
||||
|
||||
EOD
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Parse our command-line arguments.
|
||||
if (@ARGV != 1 || $ARGV[0] eq "--help") {
|
||||
print STDERR "Usage: xml-rpc-api2txt serverURL\n";
|
||||
exit 1;
|
||||
}
|
||||
|
||||
my $server = Frontier::Client->new(url => $ARGV[0]);
|
||||
|
||||
# Try (very carefully) to get our a list of methods from the server.
|
||||
local $method_list;
|
||||
eval {
|
||||
$method_list = $server->call('system.listMethods');
|
||||
};
|
||||
if ($@) {
|
||||
print STDERR <<"EOD";
|
||||
An error occurred while trying to talk to the XML-RPC server:
|
||||
|
||||
$@
|
||||
|
||||
This may have been caused by several things--the server might not support
|
||||
introspection, it might not be an XML-RPC server, or your network might be
|
||||
down. Try the following:
|
||||
|
||||
xml-rpc-api2txt http://xmlrpc-c.sourceforge.net/api/sample.php
|
||||
|
||||
EOD
|
||||
exit 1;
|
||||
}
|
||||
|
||||
# Enter the methods into a hashtable.
|
||||
my @methods = sort @$method_list;
|
||||
my %method_table;
|
||||
foreach my $method (@methods) {
|
||||
$method_table{$method} = {};
|
||||
}
|
||||
|
||||
# Get more information for the hash table. Since we need to make lots and
|
||||
# lots of very small XML-RPC calls, we'd like to use system.multicall to
|
||||
# reduce the latency.
|
||||
if (defined $method_table{'system.multicall'}) {
|
||||
|
||||
# This is messy but fast. Everybody hates HTTP round-trip lag, right?
|
||||
my @call;
|
||||
foreach my $method (@methods) {
|
||||
push @call, {methodName => 'system.methodSignature',
|
||||
params => [$method]};
|
||||
push @call, {methodName => 'system.methodHelp',
|
||||
params => [$method]};
|
||||
}
|
||||
my @result = @{$server->call('system.multicall', \@call)};
|
||||
for (my $i = 0; $i < @methods; $i++) {
|
||||
my $method = $methods[$i];
|
||||
$method_table{$method}->{'signatures'} = $result[2*$i]->[0];
|
||||
$method_table{$method}->{'help'} = $result[2*$i+1]->[0];
|
||||
}
|
||||
} else {
|
||||
|
||||
# This is easy but slow (especially over backbone links).
|
||||
foreach my $method (@methods) {
|
||||
my $signature = $server->call('system.methodSignature', $method);
|
||||
my $help = $server->call('system.methodHelp', $method);
|
||||
$method_table{$method}->{'signatures'} = $signature;
|
||||
$method_table{$method}->{'help'} = $help;
|
||||
}
|
||||
}
|
||||
|
||||
# Now, we need to dump the API.
|
||||
print <<"EOD";
|
||||
XML-RPC API for $ARGV[0]
|
||||
|
||||
See http://www.linuxdoc.org/HOWTO/XML-RPC-HOWTO/index.html for instructions
|
||||
on using XML-RPC with Perl, Python, Java, C, C++, PHP, etc.
|
||||
EOD
|
||||
foreach my $method (@methods) {
|
||||
print "\n";
|
||||
|
||||
# Print a synopsis of the function.
|
||||
if ($method_table{$method}->{'signatures'} eq 'undef') {
|
||||
# No documentation. Bad server. No biscuit.
|
||||
print "unknown $method (...)\n";
|
||||
} else {
|
||||
for my $signature (@{$method_table{$method}->{'signatures'}}) {
|
||||
my $return_type = shift @$signature;
|
||||
my $arguments = join(", ", @$signature);
|
||||
print "$return_type $method ($arguments)\n";
|
||||
}
|
||||
}
|
||||
print "\n";
|
||||
|
||||
my $help = $method_table{$method}->{'help'};
|
||||
if ($help =~ /\n/) {
|
||||
# Text has already been broken into lines by the server, so just
|
||||
# indent it by two spaces and hope for the best.
|
||||
my @lines = split(/\n/, $help);
|
||||
my $help = " " . join("\n ", @lines);
|
||||
print "$help\n";
|
||||
} else {
|
||||
# Print our help text in a nicely-wrapped fashion using Perl's
|
||||
# formatting routines.
|
||||
$helptext = $method_table{$method}->{'help'};
|
||||
write;
|
||||
}
|
||||
}
|
||||
|
||||
format STDOUT =
|
||||
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<~~
|
||||
$helptext
|
||||
.
|
||||
@@ -1,47 +0,0 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH XML-RPC-API2TXT 1 "June 27, 2001"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
xml-rpc-api2txt \- Print out a description of an XML-RPC API as text
|
||||
.SH SYNOPSIS
|
||||
.B xml-rpc-api2txt
|
||||
\fIserver-url\fR
|
||||
.SH DESCRIPTION
|
||||
xml-rpc-api2txt queries an XML-RPC server using the XML-RPC
|
||||
Instrospection API designed by Edd Dumbill. It then prints the
|
||||
results to standard output in a nicely formatted form, suitable for
|
||||
sending via e-mail.
|
||||
.PP
|
||||
You can find a list of supported XML-RPC server libraries (and patches
|
||||
for many others) at \fBhttp://xmlrpc-c.sourceforge.net/hacks.php\fR.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.I server-url
|
||||
The name of the server to query. Try
|
||||
\fBhttp://xmlrpc-c.sourceforge.net/cgi-bin/interop.cgi\fR.
|
||||
.SH BUGS
|
||||
xml-rpc-api2txt assumes that method descriptions are ASCII text, not
|
||||
HTML as specified in the standard. (In practice, both conventions are
|
||||
often seen.)
|
||||
.SH SEE ALSO
|
||||
.BR xmlrpc-c (7),
|
||||
.BR xml-rpc-api2cpp (1).
|
||||
.PP
|
||||
This program is part of xmlrpc-c.
|
||||
.SH AUTHOR
|
||||
This manual page was written by Eric Kidd <eric.kidd@pobox.com>.
|
||||
It may be distributed under the same terms as the rest of xmlrpc-c.
|
||||
@@ -1 +0,0 @@
|
||||
xmlrpc
|
||||
@@ -21,8 +21,6 @@ INCLUDES = \
|
||||
-Isrcdir/include \
|
||||
-Isrcdir/lib/util/include
|
||||
|
||||
CFLAGS = $(CFLAGS_COMMON) $(INCLUDES) $(CFLAGS_PERSONAL) $(CADD)
|
||||
|
||||
LDFLAGS = $(LADD)
|
||||
|
||||
all: xmlrpc
|
||||
@@ -36,7 +34,7 @@ UTIL_OBJS = \
|
||||
|
||||
UTILS = $(UTIL_OBJS:%=$(UTIL_DIR)/%)
|
||||
|
||||
DUMPVALUE = srcdir/tools/lib/dumpvalue.o
|
||||
DUMPVALUE = blddir/tools/lib/dumpvalue.o
|
||||
|
||||
# Can we just use $(LIBS) in the link?
|
||||
|
||||
@@ -48,14 +46,14 @@ xmlrpc: $(XMLRPC_OBJS) $(LIBS) $(UTILS)
|
||||
$(CCLD) -o $@ $(LDFLAGS) $(XMLRPC_OBJS) $(UTILS) $(CLIENT_LDLIBS)
|
||||
|
||||
%.o:%.c $(BLDDIR)/include/xmlrpc-c/config.h
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
$(CC) -c $(CFLAGS_ALL) $<
|
||||
|
||||
# This common.mk dependency makes sure the symlinks get built before
|
||||
# this make file is used for anything.
|
||||
|
||||
$(SRCDIR)/tools/common.mk: srcdir blddir
|
||||
|
||||
include Makefile.depend
|
||||
include depend.mk
|
||||
|
||||
.PHONY: dep
|
||||
dep: dep-common
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
*/
|
||||
|
||||
//#define _GNU_SOURCE
|
||||
#define _XOPEN_SOURCE 600 /* Make sure strdup() is in <string.h> */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
@@ -55,6 +55,7 @@
|
||||
|
||||
#include "xmlrpc-c/base.h"
|
||||
#include "xmlrpc-c/client.h"
|
||||
#include "xmlrpc-c/string_int.h"
|
||||
|
||||
#define NAME "xmlrpc command line program"
|
||||
#define VERSION "1.0"
|
||||
@@ -259,6 +260,33 @@ buildString(xmlrpc_env * const envP,
|
||||
|
||||
|
||||
|
||||
static void
|
||||
interpretHex(xmlrpc_env * const envP,
|
||||
const char * const valueString,
|
||||
size_t const valueStringSize,
|
||||
unsigned char * const byteString) {
|
||||
|
||||
size_t bsCursor;
|
||||
size_t strCursor;
|
||||
|
||||
for (strCursor = 0, bsCursor = 0;
|
||||
strCursor < valueStringSize && !envP->fault_occurred;
|
||||
) {
|
||||
int rc;
|
||||
|
||||
rc = sscanf(&valueString[strCursor], "%2hhx",
|
||||
&byteString[bsCursor++]);
|
||||
|
||||
if (rc != 1)
|
||||
xmlrpc_faultf(envP, "Invalid hex data '%s'",
|
||||
&valueString[strCursor]);
|
||||
else
|
||||
strCursor += 2;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
buildBytestring(xmlrpc_env * const envP,
|
||||
const char * const valueString,
|
||||
@@ -269,33 +297,25 @@ buildBytestring(xmlrpc_env * const envP,
|
||||
if (valueStringSize / 2 * 2 != valueStringSize)
|
||||
xmlrpc_faultf(envP, "Hexadecimal text is not an even "
|
||||
"number of characters (it is %u characters)",
|
||||
strlen(valueString));
|
||||
(unsigned)strlen(valueString));
|
||||
else {
|
||||
size_t const byteStringSize = strlen(valueString)/2;
|
||||
|
||||
unsigned char byteString[byteStringSize];
|
||||
size_t bsCursor;
|
||||
size_t strCursor;
|
||||
unsigned char * byteString;
|
||||
|
||||
strCursor = 0;
|
||||
bsCursor = 0;
|
||||
MALLOCARRAY(byteString, byteStringSize);
|
||||
|
||||
while (strCursor < valueStringSize && !envP->fault_occurred) {
|
||||
int rc;
|
||||
if (byteString == NULL)
|
||||
xmlrpc_faultf(envP, "Failed to allocate %u-byte buffer",
|
||||
(unsigned)byteStringSize);
|
||||
else {
|
||||
interpretHex(envP, valueString, valueStringSize, byteString);
|
||||
|
||||
assert(bsCursor < byteStringSize);
|
||||
if (!envP->fault_occurred)
|
||||
*paramPP = xmlrpc_base64_new(envP, byteStringSize, byteString);
|
||||
|
||||
rc = sscanf(&valueString[strCursor], "%2hhx",
|
||||
&byteString[bsCursor++]);
|
||||
|
||||
if (rc != 1)
|
||||
xmlrpc_faultf(envP, "Invalid hex data '%s'",
|
||||
&valueString[strCursor]);
|
||||
else
|
||||
strCursor += 2;
|
||||
free(byteString);
|
||||
}
|
||||
if (!envP->fault_occurred)
|
||||
*paramPP = xmlrpc_base64_new(envP, byteStringSize, byteString);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -409,19 +429,19 @@ computeParameter(xmlrpc_env * const envP,
|
||||
const char * const paramArg,
|
||||
xmlrpc_value ** const paramPP) {
|
||||
|
||||
if (strncmp(paramArg, "s/", 2) == 0)
|
||||
if (xmlrpc_strneq(paramArg, "s/", 2))
|
||||
buildString(envP, ¶mArg[2], paramPP);
|
||||
else if (strncmp(paramArg, "h/", 2) == 0)
|
||||
else if (xmlrpc_strneq(paramArg, "h/", 2))
|
||||
buildBytestring(envP, ¶mArg[2], paramPP);
|
||||
else if (strncmp(paramArg, "i/", 2) == 0)
|
||||
else if (xmlrpc_strneq(paramArg, "i/", 2))
|
||||
buildInt(envP, ¶mArg[2], paramPP);
|
||||
else if (strncmp(paramArg, "I/", 2) == 0)
|
||||
else if (xmlrpc_strneq(paramArg, "I/", 2))
|
||||
buildI8(envP, ¶mArg[2], paramPP);
|
||||
else if (strncmp(paramArg, "d/", 2) == 0)
|
||||
else if (xmlrpc_strneq(paramArg, "d/", 2))
|
||||
buildDouble(envP, ¶mArg[2], paramPP);
|
||||
else if (strncmp(paramArg, "b/", 2) == 0)
|
||||
else if (xmlrpc_strneq(paramArg, "b/", 2))
|
||||
buildBool(envP, ¶mArg[2], paramPP);
|
||||
else if (strncmp(paramArg, "n/", 2) == 0)
|
||||
else if (xmlrpc_strneq(paramArg, "n/", 2))
|
||||
buildNil(envP, ¶mArg[2], paramPP);
|
||||
else {
|
||||
/* It's not in normal type/value format, so we take it to be
|
||||
|
||||
@@ -34,7 +34,7 @@ http://gggeek.damacom.it/debugger/</a>
|
||||
|
||||
<pre>
|
||||
<tt>
|
||||
$ xmlrpc http://xmlrpc.server.net/~bryanh echostring \
|
||||
$ xmlrpc http://xmlrpc.example.com/~bryanh echostring \
|
||||
"s/This is a string"
|
||||
Result:
|
||||
String: This is a string
|
||||
@@ -44,7 +44,7 @@ http://gggeek.damacom.it/debugger/</a>
|
||||
|
||||
<pre>
|
||||
<tt>
|
||||
$ xmlrpc http://xmlrpc.server.net/~bryanh echostring \
|
||||
$ xmlrpc http://xmlrpc.example.com/~bryanh echostring \
|
||||
"This is a string in shortcut syntax"
|
||||
Result:
|
||||
String: This is a string in shortcut syntax
|
||||
@@ -53,7 +53,7 @@ http://gggeek.damacom.it/debugger/</a>
|
||||
</pre>
|
||||
<pre>
|
||||
<tt>
|
||||
$ xmlrpc http://xmlrpc.server.net sample.add i/3 i/5 \
|
||||
$ xmlrpc http://xmlrpc.example.com sample.add i/3 i/5 \
|
||||
transport=curl -curlinterface=eth1 -username=bryanh -password=passw0rd
|
||||
Result:
|
||||
Integer: 8
|
||||
|
||||
@@ -14,9 +14,11 @@ PROGRAMS_TO_INSTALL = xmlrpc_cpp_proxy
|
||||
|
||||
include $(SRCDIR)/tools/common.mk
|
||||
|
||||
INCLUDES = -I$(BLDDIR) -I$(BLDDIR)/include -I$(SRCDIR)/include
|
||||
# <sstream.h> in Glibc 2.2 has a bug that results in inlining failure,
|
||||
# so we disable warnings for that:
|
||||
CFLAGS_LOCAL = -Wno-inline
|
||||
|
||||
CXXFLAGS = $(INCLUDES) $(CXXFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
|
||||
INCLUDES = -I$(BLDDIR) -I$(BLDDIR)/include -Isrcdir/include
|
||||
|
||||
LDFLAGS = $(LADD)
|
||||
|
||||
@@ -43,14 +45,14 @@ xmlrpc_cpp_proxy: $(OBJECTS) $(LIBS)
|
||||
$(CXXLD) -o $@ $(LDFLAGS) $(OBJECTS) $(LDLIBS) $(LADD)
|
||||
|
||||
%.o:%.cpp $(BLDDIR)/include/xmlrpc-c/config.h
|
||||
$(CXX) -c $(CXXFLAGS) $<
|
||||
$(CXX) -c $(CXXFLAGS_ALL) $<
|
||||
|
||||
# This common.mk dependency makes sure the symlinks get built before
|
||||
# this make file is used for anything.
|
||||
|
||||
$(SRCDIR)/tools/common.mk: srcdir blddir
|
||||
|
||||
include Makefile.depend
|
||||
include depend.mk
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-common
|
||||
|
||||
@@ -23,15 +23,13 @@ INCLUDES = \
|
||||
-Iblddir/include \
|
||||
-Isrcdir/include \
|
||||
|
||||
CXXFLAGS = $(INCLUDES) $(CXXFLAGS_COMMON) $(CFLAGS_PERSONAL) $(CADD)
|
||||
|
||||
LDFLAGS = $(LADD)
|
||||
|
||||
all: xmlrpc_pstream
|
||||
|
||||
OBJECTS = \
|
||||
xmlrpc_pstream.o \
|
||||
$(TOOLSDIR)/lib/dumpvalue.o \
|
||||
blddir/tools/lib/dumpvalue.o \
|
||||
|
||||
LIBS = \
|
||||
$(LIBXMLRPC_CLIENTPP) \
|
||||
@@ -57,14 +55,14 @@ xmlrpc_pstream: $(OBJECTS) $(LIBS) $(UTILS)
|
||||
$(CXXLD) -o $@ $(LDFLAGS) $(OBJECTS) $(UTILS) $(LDLIBS) $(LADD)
|
||||
|
||||
%.o:%.cpp blddir/include/xmlrpc-c/config.h
|
||||
$(CXX) -c $(CXXFLAGS) $<
|
||||
$(CXX) -c $(CXXFLAGS_ALL) $<
|
||||
|
||||
# This common.mk dependency makes sure the symlinks get built before
|
||||
# this make file is used for anything.
|
||||
|
||||
$(SRCDIR)/common.mk: srcdir blddir
|
||||
$(SRCDIR)/tools/common.mk: srcdir blddir
|
||||
|
||||
include Makefile.depend
|
||||
include depend.mk
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-common
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <readline/readline.h>
|
||||
|
||||
@@ -121,7 +121,7 @@ You may specify no parameters if you like.
|
||||
a slash. Example: <b>i/5</b>. Here, the "i" signifies an
|
||||
integer data type. "5" is the value.
|
||||
|
||||
<p><b>xmlrpc</b> is capable of only a subset of the
|
||||
<p><b>xmlrpc_pstream</b> is capable of only a subset of the
|
||||
possible XML-RPC types, as follows by prefix:
|
||||
|
||||
<dl>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
xmlrpc_transport
|
||||
@@ -17,10 +17,8 @@ include $(SRCDIR)/tools/common.mk
|
||||
INCLUDES = \
|
||||
-I$(BLDDIR) \
|
||||
-I$(BLDDIR)/include \
|
||||
-I$(SRCDIR)/include \
|
||||
-I$(SRCDIR)/lib/util/include
|
||||
|
||||
CFLAGS = $(CFLAGS_COMMON) $(INCLUDES) $(CFLAGS_PERSONAL) $(CADD)
|
||||
-Isrcdir/include \
|
||||
-Isrcdir/lib/util/include
|
||||
|
||||
LDFLAGS = $(LADD)
|
||||
|
||||
@@ -35,27 +33,20 @@ UTIL_OBJS = \
|
||||
|
||||
UTILS = $(UTIL_OBJS:%=$(UTIL_DIR)/%)
|
||||
|
||||
# These are the Libtool .la files. We use them only for make dependencies.
|
||||
# We'd like to use these in the link rule, by using libtool --link, but
|
||||
# Libtool adds -l options to the link to cover the dependencies that are
|
||||
# recorded inside the shared libraries. And it doesn't add the necessary
|
||||
# -L options (it can't), so we end up with a messy mixture of the two
|
||||
# forms of specifying libraries.
|
||||
|
||||
LIBS = $(LIBXMLRPC_CLIENT) $(LIBXMLRPC) $(LIBXMLRPC_XML) $(LIBXMLRPC_UTIL)
|
||||
|
||||
xmlrpc_transport:%:%.o $(LIBS) $(UTILS)
|
||||
$(CCLD) -o $@ $(LDFLAGS) $< $(CLIENT_LDLIBS) $(UTILS)
|
||||
|
||||
%.o:%.c
|
||||
$(CC) -c $(CFLAGS) $<
|
||||
$(CC) -c $(CFLAGS_ALL) $<
|
||||
|
||||
# This common.mk dependency makes sure the symlinks get built before
|
||||
# this make file is used for anything.
|
||||
|
||||
$(SRCDIR)/tools/common.mk: srcdir blddir
|
||||
|
||||
include Makefile.depend
|
||||
include depend.mk
|
||||
|
||||
.PHONY: dep
|
||||
dep: dep-common
|
||||
|
||||
@@ -1,120 +0,0 @@
|
||||
#! /bin/sh
|
||||
|
||||
# xmlrpc_transport - temporary wrapper script for .libs/xmlrpc_transport
|
||||
# Generated by ltmain.sh - GNU libtool 1.3.4 (1.385.2.196 1999/12/07 21:47:57)
|
||||
#
|
||||
# The xmlrpc_transport program cannot be directly executed until all the libtool
|
||||
# libraries that it depends on are installed.
|
||||
#
|
||||
# This wrapper script should never be moved out of the build directory.
|
||||
# If it is, it will not operate correctly.
|
||||
|
||||
# Sed substitution that helps us do robust quoting. It backslashifies
|
||||
# metacharacters that are still active within double-quoted strings.
|
||||
Xsed='sed -e 1s/^X//'
|
||||
sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
|
||||
|
||||
# The HP-UX ksh and POSIX shell print the target directory to stdout
|
||||
# if CDPATH is set.
|
||||
if test "${CDPATH+set}" = set; then CDPATH=:; export CDPATH; fi
|
||||
|
||||
relink_command="gcc -o \$progdir/\$file -L /usr/link/w3c-libwww -lwwwxml -lxmltok -lxmlparse -lwwwzip -lwwwinit -lwwwapp -lwwwhtml -lwwwtelnet -lwwwnews -lwwwhttp -lwwwmime -lwwwgopher -lwwwftp -lwwwfile -lwwwdir -lwwwcache -lwwwstream -lwwwmux -lwwwtrans -lwwwcore -lwwwutils -lmd5 -ldl -lz -L /subsys/openssl/link -lssl -lcrypto -L/subsys/curl/lib -lcurl -lssl -lcrypto -ldl -lz -lpthread xmlrpc_transport.o /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../src/.libs/libxmlrpc_client.so /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../src/.libs/libxmlrpc.so /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../lib/expat/xmlparse/.libs/libxmlrpc_xmlparse.so /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../lib/expat/xmltok/.libs/libxmlrpc_xmltok.so /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../lib/util/cmdline_parser.o /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../lib/util/getoptx.o -Wl,--rpath -Wl,/mp/hdc1/xmlrpc-c-1.03.14/src/.libs -Wl,--rpath -Wl,/mp/hdc1/xmlrpc-c-1.03.14/lib/expat/xmlparse/.libs -Wl,--rpath -Wl,/mp/hdc1/xmlrpc-c-1.03.14/lib/expat/xmltok/.libs -Wl,--rpath -Wl,/usr/local/lib"
|
||||
|
||||
# This environment variable determines our operation mode.
|
||||
if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
|
||||
# install mode needs the following variable:
|
||||
link_against_libtool_libs=' /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../src/libxmlrpc_client.la /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../src/libxmlrpc.la /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../lib/expat/xmlparse/libxmlrpc_xmlparse.la /mp/hdc1/xmlrpc-c-1.03.14/tools/xmlrpc_transport/../../lib/expat/xmltok/libxmlrpc_xmltok.la'
|
||||
else
|
||||
# When we are sourced in execute mode, $file and $echo are already set.
|
||||
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
||||
echo="/syspathbasic/echo"
|
||||
file="$0"
|
||||
# Make sure echo works.
|
||||
if test "X$1" = X--no-reexec; then
|
||||
# Discard the --no-reexec flag, and continue.
|
||||
shift
|
||||
elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
|
||||
# Yippee, $echo works!
|
||||
:
|
||||
else
|
||||
# Restart under the correct shell, and then maybe $echo will work.
|
||||
exec /bin/sh "$0" --no-reexec ${1+"$@"}
|
||||
fi
|
||||
fi
|
||||
|
||||
# Find the directory that this script lives in.
|
||||
thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
|
||||
test "x$thisdir" = "x$file" && thisdir=.
|
||||
|
||||
# Follow symbolic links until we get to the real thisdir.
|
||||
file=`ls -ld "$file" | sed -n 's/.*-> //p'`
|
||||
while test -n "$file"; do
|
||||
destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
|
||||
|
||||
# If there was a directory component, then change thisdir.
|
||||
if test "x$destdir" != "x$file"; then
|
||||
case "$destdir" in
|
||||
[\/]* | [A-Za-z]:[\/]*) thisdir="$destdir" ;;
|
||||
*) thisdir="$thisdir/$destdir" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
|
||||
file=`ls -ld "$thisdir/$file" | sed -n 's/.*-> //p'`
|
||||
done
|
||||
|
||||
# Try to get the absolute directory name.
|
||||
absdir=`cd "$thisdir" && pwd`
|
||||
test -n "$absdir" && thisdir="$absdir"
|
||||
|
||||
program=lt-'xmlrpc_transport'
|
||||
progdir="$thisdir/.libs"
|
||||
|
||||
if test ! -f "$progdir/$program" || \
|
||||
{ file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | sed 1q`; \
|
||||
test "X$file" != "X$progdir/$program"; }; then
|
||||
|
||||
file="$$-$program"
|
||||
|
||||
if test ! -d "$progdir"; then
|
||||
mkdir "$progdir"
|
||||
else
|
||||
rm -f "$progdir/$file"
|
||||
fi
|
||||
|
||||
# relink executable if necessary
|
||||
if test -n "$relink_command"; then
|
||||
if (cd "$thisdir" && eval $relink_command); then :
|
||||
else
|
||||
rm -f "$progdir/$file"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
mv -f "$progdir/$file" "$progdir/$program" 2>/dev/null ||
|
||||
{ rm -f "$progdir/$program";
|
||||
mv -f "$progdir/$file" "$progdir/$program"; }
|
||||
rm -f "$progdir/$file"
|
||||
fi
|
||||
|
||||
if test -f "$progdir/$program"; then
|
||||
if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
|
||||
# Run the actual program with our arguments.
|
||||
|
||||
# Export the path to the program.
|
||||
PATH="$progdir:$PATH"
|
||||
export PATH
|
||||
|
||||
exec $program ${1+"$@"}
|
||||
|
||||
$echo "$0: cannot exec $program ${1+"$@"}"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
# The program doesn't exist.
|
||||
$echo "$0: error: $progdir/$program does not exist" 1>&2
|
||||
$echo "This script is just a wrapper for $program." 1>&2
|
||||
echo "See the libtool documentation for more information." 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
@@ -2,7 +2,7 @@
|
||||
an XML-RPC call.
|
||||
*/
|
||||
|
||||
//#define _GNU_SOURCE
|
||||
#define _XOPEN_SOURCE 600 /* Make sure strdup() is in <string.h> */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
Reference in new issue
Block a user