Skip to content

Commit 4a3bcc7

Browse files
author
giraffedata
committed
Release 01.23.00
git-svn-id: https://xmlrpc-c.svn.sourceforge.net/svnroot/xmlrpc-c/advanced@1953 adbb7d4b-a73a-0410-a071-c5f57c452bd4
1 parent 7f8a5a1 commit 4a3bcc7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1155
-447
lines changed

configure.in

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -467,9 +467,6 @@ if test $MUST_BUILD_WININET_CLIENT = yes; then
467467
WININET_LDADD="`$WININET_CONFIG --libs`"
468468
AC_SUBST(WININET_LDADD)
469469

470-
dnl Oh, such massive brain damage! Because there may be another copy
471-
dnl of libwww in the default dynamic loader search path, we need to
472-
dnl adjust the search patch manually. Just gag me with a backquote, OK?
473470
AC_MSG_CHECKING(for wininet library directory)
474471
if $WININET_CONFIG --rpath-dir > /dev/null 2>&1; then
475472
dnl Yay! We're using our smart version of wininet.
@@ -538,9 +535,6 @@ if test $MUST_BUILD_LIBWWW_CLIENT = yes; then
538535
LIBWWW_LDADD="`$LIBWWW_CONFIG --libs`"
539536
AC_SUBST(LIBWWW_LDADD)
540537

541-
dnl Oh, such massive brain damage! Because there may be another copy
542-
dnl of libwww in the default dynamic loader search path, we need to
543-
dnl adjust the search patch manually. Just gag me with a backquote, OK?
544538
AC_MSG_CHECKING(for libwww library directory)
545539
if $LIBWWW_CONFIG --rpath-dir > /dev/null 2>&1; then
546540
dnl Yay! We're using our smart version of libwww.
@@ -567,12 +561,12 @@ fi # MUST_BUILD_LIBWWW_CLIENT
567561

568562

569563
dnl =======================================================================
570-
dnl Finding cURL
564+
dnl Finding Curl
571565
dnl =======================================================================
572566

573567
if test $MUST_BUILD_CURL_CLIENT = yes; then
574568

575-
dnl First of all, locate the curl config program.
569+
dnl First of all, locate the Curl config program.
576570
dnl You can control which of these gets chosen by fooling around with PATH.
577571
AC_PATH_PROGS(CURL_CONFIG, curl-xmlrpc-config curl-config, no)
578572
if test "x$CURL_CONFIG" = "xno"; then
@@ -581,7 +575,7 @@ if test $MUST_BUILD_CURL_CLIENT = yes; then
581575

582576
dnl There used to be code here to check the Curl version and make sure
583577
dnl it is at least 7.8. But there were bugs both in the code and in
584-
dnl curl (curl-config --vernum, at least in older versios of Curl,
578+
dnl curl (curl-config --vernum, at least in older versions of Curl,
585579
dnl omits the leading zero). So it didn't work. Plus, checking version
586580
dnl numbers isn't a good idea. Better to check for feature presence.
587581
dnl So we don't do any check now. If we find out there's a problem with
@@ -594,11 +588,9 @@ if test $MUST_BUILD_CURL_CLIENT = yes; then
594588
CURL_LDADD=`$CURL_CONFIG --libs`
595589
AC_SUBST(CURL_LDADD)
596590

597-
dnl Oh, such massive brain damage! Because there may be another copy
598-
dnl of curl in the default dynamic loader search path, we need to
599-
dnl adjust the search path manually. Just gag me with a backquote, OK?
600-
AC_MSG_CHECKING(for curl library directory)
601-
dnl Yawn. We're using the regular boring version.
591+
AC_MSG_CHECKING(for Curl library directory)
592+
dnl Curl-config doesn't know about rpath, so we just make some
593+
dnl assumptions:
602594
CURL_LIBDIR="`$CURL_CONFIG --prefix`/lib"
603595

604596
AC_MSG_RESULT($CURL_LIBDIR)

doc/INSTALL

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ by modifying the file 'config.mk' after 'configure' creates it. The default
119119
value of these variables (as set in 'config.mk') is the same compile and link
120120
commands as for building target code.
121121

122+
(There is probably a way to do this with GNU Autoconf facilities and avoid the
123+
BUILDTOOL_CC complication. If you know how (without using Automake), tell the
124+
Xmlrpc-c maintainer and he will change the build system to use it).
125+
122126

123127
COMMON PROBLEMS
124128
---------------

examples/cpp/xmlrpc_sample_add_server.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ main(int const,
6262
myRegistry.addMethod("sample.add", sampleAddMethodP);
6363

6464
xmlrpc_c::serverAbyss myAbyssServer(
65-
myRegistry,
66-
8080, // TCP port on which to listen
67-
"/tmp/xmlrpc_log" // Log file
68-
);
65+
xmlrpc_c::serverAbyss::constrOpt()
66+
.registryP(&myRegistry)
67+
.portNumber(8080));
6968

7069
myAbyssServer.run();
7170
// xmlrpc_c::serverAbyss.run() never returns

examples/json.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
XML-RPC XML text. It then re-generates JSON from the intermediate
77
parsed information and displays that.
88
*/
9+
#include <stdlib.h>
910
#include <stdio.h>
1011

1112
#include <xmlrpc-c/json.h>

examples/xmlrpc_sample_add_client.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
/* A simple synchronous XML-RPC client written in C, as an example of
2-
an Xmlrpc-c client. This invokes the sample.add procedure that the
3-
Xmlrpc-c example server.c server provides. I.e. it adds two numbers
4-
together, the hard way.
1+
/* A simple synchronous XML-RPC client written in C, as an example of an
2+
Xmlrpc-c client. This invokes the sample.add procedure that the Xmlrpc-c
3+
example xmlrpc_sample_add_server.c server provides. I.e. it adds two
4+
numbers together, the hard way.
5+
6+
This sends the RPC to the server running on the local system ("localhost"),
7+
HTTP Port 8080.
58
*/
69

710
#include <stdlib.h>

examples/xmlrpc_sample_add_server.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
/* A simple standalone XML-RPC server written in C. */
22

3+
/* This server knows one RPC class (besides the system classes):
4+
"sample.add".
5+
6+
The program takes one argument: the HTTP port number on which the server
7+
is to accept connections, in decimal.
8+
9+
You can use the example program 'xmlrpc_sample_add_client' to send an RPC
10+
to this server.
11+
12+
Example:
13+
14+
$ ./xmlrpc_sample_add_server 8080&
15+
$ ./xmlrpc_sample_add_client
16+
17+
For more fun, run client and server in separate terminals and turn on
18+
tracing for each:
19+
20+
$ export XMLRPC_TRACE_XML=1
21+
*/
22+
323
#include <stdlib.h>
424
#include <stdio.h>
525
#ifdef WIN32

include/Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ xmlrpc-c/config.h: $(BLDDIR)/$(SUBDIR)/xmlrpc-c
4747
@echo '#if defined(_MSC_VER)' >>$@
4848
@echo ' /* Newer MSVC has long long, but MSVC 6 does not */' >>$@
4949
@echo ' #define XMLRPC_INT64 __int64' >>$@
50+
@echo ' #define XMLRPC_PRId64 "I64"' >>$@
5051
@echo ' #define XMLRPC_INT32 __int32' >>$@
5152
@echo '#else' >>$@
5253
@echo ' #define XMLRPC_INT64 long long' >>$@
54+
@echo ' #define XMLRPC_PRId64 "lld"' >>$@
5355
@echo ' #define XMLRPC_INT32 int' >>$@
5456
@echo '#endif' >>$@
5557
@echo '#endif' >>$@
@@ -133,9 +135,11 @@ install-compat-hdr: install-headers
133135
.PHONY: install
134136
install: install-common install-compat-hdr
135137

136-
.PHONY: clean distclean dep
138+
.PHONY: clean
137139
clean:
138140
rm -f xmlrpc-c/config.h
141+
142+
.PHONY: distclean
139143
distclean: clean
140144

141145
.PHONY: check

include/xmlrpc-c/client.h

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#ifndef XMLRPC_CLIENT_H_INCLUDED
1111
#define XMLRPC_CLIENT_H_INCLUDED
1212

13+
#include <stdarg.h>
1314
#include <xmlrpc-c/base.h>
1415

1516
#ifdef __cplusplus
@@ -50,6 +51,29 @@ enum xmlrpc_sslversion {
5051
XMLRPC_SSLVERSION_SSLv3
5152
};
5253

54+
55+
enum xmlrpc_httpauthtype {
56+
/* These are just constants. They can be or'ed as integers to create
57+
a set.
58+
*/
59+
XMLRPC_HTTPAUTH_BASIC = (1<<0),
60+
XMLRPC_HTTPAUTH_DIGEST = (1<<1),
61+
XMLRPC_HTTPAUTH_GSSNEGOTIATE = (1<<2),
62+
XMLRPC_HTTPAUTH_NTLM = (1<<3),
63+
};
64+
65+
/* The following are useful combinations of the HTTP authentication types
66+
above.
67+
*/
68+
#define XMLRPC_HTTPAUTH_NONE 0
69+
#define XMLRPC_HTTPAUTH_ANY ~0
70+
#define XMLRPC_HTTPAUTH_ANYSAFE (~XMLRPC_HTTPAUTH_BASIC)
71+
72+
enum xmlrpc_httpproxytype {
73+
XMLRPC_HTTPPROXY_HTTP = 0,
74+
XMLRPC_HTTPPROXY_SOCKS5 = 5
75+
};
76+
5377
struct xmlrpc_curl_xportparms {
5478
/* This is designed so that zero values are always the defaults. */
5579
const char * network_interface;
@@ -72,6 +96,14 @@ struct xmlrpc_curl_xportparms {
7296
const char * ssl_cipher_list;
7397
unsigned int timeout;
7498
xmlrpc_bool dont_advertise;
99+
const char * proxy;
100+
unsigned int proxy_port;
101+
enum xmlrpc_httpproxytype proxy_type;
102+
unsigned int proxy_auth;
103+
/* A set of authentication schemes -- an OR of
104+
enum xmlrpc_httpproxyauth values
105+
*/
106+
const char * proxy_userpwd;
75107
};
76108

77109

@@ -252,6 +284,15 @@ xmlrpc_client_call2f(xmlrpc_env * const envP,
252284
const char * const format,
253285
...);
254286

287+
void
288+
xmlrpc_client_call2f_va(xmlrpc_env * const envP,
289+
xmlrpc_client * const clientP,
290+
const char * const serverUrl,
291+
const char * const methodName,
292+
const char * const format,
293+
xmlrpc_value ** const resultPP,
294+
va_list args);
295+
255296
void
256297
xmlrpc_client_event_loop_finish(xmlrpc_client * const clientP);
257298

@@ -260,13 +301,13 @@ xmlrpc_client_event_loop_finish_timeout(xmlrpc_client * const clientP,
260301
unsigned long const milliseconds);
261302

262303
void
263-
xmlrpc_client_start_rpc(xmlrpc_env * const envP,
264-
struct xmlrpc_client * const clientP,
265-
xmlrpc_server_info * const serverInfoP,
266-
const char * const methodName,
267-
xmlrpc_value * const argP,
268-
xmlrpc_response_handler responseHandler,
269-
void * const userData);
304+
xmlrpc_client_start_rpc(xmlrpc_env * const envP,
305+
struct xmlrpc_client * const clientP,
306+
const xmlrpc_server_info * const serverInfoP,
307+
const char * const methodName,
308+
xmlrpc_value * const argP,
309+
xmlrpc_response_handler responseHandler,
310+
void * const userData);
270311

271312
void
272313
xmlrpc_client_start_rpcf(xmlrpc_env * const envP,
@@ -278,6 +319,16 @@ xmlrpc_client_start_rpcf(xmlrpc_env * const envP,
278319
const char * const format,
279320
...);
280321

322+
void
323+
xmlrpc_client_start_rpcf_va(xmlrpc_env * const envP,
324+
xmlrpc_client * const clientP,
325+
const char * const serverUrl,
326+
const char * const methodName,
327+
xmlrpc_response_handler responseHandler,
328+
void * const userData,
329+
const char * const format,
330+
va_list args);
331+
281332
void
282333
xmlrpc_client_set_interrupt(xmlrpc_client * const clientP,
283334
int * const interruptP);

include/xmlrpc-c/client.hpp

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,16 +211,18 @@ class rpc : public clientTransaction {
211211
An RPC. An RPC consists of method name, parameters, and result. It
212212
does not specify in any way how the method name and parameters get
213213
turned into a result. It does not presume XML or HTTP.
214-
215-
You don't create an object of this class directly. All references to
216-
an rpc object should be by an rpcPtr object. Create a new RPC by
217-
creating a new rpcPtr. Accordingly, our constructors and destructors
218-
are protected, but available to our friend class rpcPtr.
219-
214+
215+
You don't normally create or reference an object of this class directly,
216+
but rather via an 'rpcPtr' object. That takes care of deleting the object
217+
when you are done with it (but not before). This is critical if you plan
218+
to use the 'start' method, because without an rpcPtr reference, the system
219+
will destroy the object under the covers when the RPC finishes, and there
220+
is no way for you to guarantee you won't still access it after it finishes
221+
(because of accesses within Xmlrpc-c calls such as the call that finishes
222+
the RPC or just rpc::start).
223+
220224
In order to do asynchronous RPCs, you normally have to create a derived
221-
class that defines a useful notifyComplete(). If you do that, you'll
222-
want to make sure the derived class objects get accessed only via rpcPtrs
223-
as well.
225+
class that defines a useful notifyComplete().
224226
-----------------------------------------------------------------------------*/
225227
friend class xmlrpc_c::rpcPtr;
226228

include/xmlrpc-c/client_int.h

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,35 @@ xmlrpc_client_event_loop_end (void);
8686
extern int
8787
xmlrpc_client_asynch_calls_are_unfinished (void);
8888

89+
90+
91+
/*=========================================================================
92+
** Interface between global client and general client functions.
93+
** (These are necessary because there are some global client functions
94+
** that don't have exported private client versions because we don't like
95+
** them and have them for global functions only for backward compatibility.
96+
** The global client functions existed before any private client ones did).
97+
**========================================================================= */
98+
void
99+
xmlrpc_client_call_server2_va(xmlrpc_env * const envP,
100+
struct xmlrpc_client * const clientP,
101+
const xmlrpc_server_info * const serverInfoP,
102+
const char * const methodName,
103+
const char * const format,
104+
va_list args,
105+
xmlrpc_value ** const resultPP);
106+
107+
void
108+
xmlrpc_client_start_rpcf_server_va(
109+
xmlrpc_env * const envP,
110+
struct xmlrpc_client * const clientP,
111+
const xmlrpc_server_info * const serverInfoP,
112+
const char * const methodName,
113+
xmlrpc_response_handler responseHandler,
114+
void * const userData,
115+
const char * const format,
116+
va_list args);
117+
89118
/* Copyright (C) 2001 by First Peer, Inc. All rights reserved.
90119
**
91120
** Redistribution and use in source and binary forms, with or without

include/xmlrpc-c/client_transport.hpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,11 @@ class clientXmlTransport_curl : public xmlrpc_c::clientXmlTransport_http {
273273
constrOpt & egdsocket (std::string const& arg);
274274
constrOpt & ssl_cipher_list (std::string const& arg);
275275
constrOpt & timeout (unsigned int const& arg);
276+
constrOpt & proxy (std::string const& arg);
277+
constrOpt & proxy_port (unsigned int const& arg);
278+
constrOpt & proxy_auth (unsigned int const& arg);
279+
constrOpt & proxy_userpwd (std::string const& arg);
280+
constrOpt & proxy_type (xmlrpc_httpproxytype const& arg);
276281

277282
struct {
278283
std::string network_interface;
@@ -295,6 +300,11 @@ class clientXmlTransport_curl : public xmlrpc_c::clientXmlTransport_http {
295300
std::string egdsocket;
296301
std::string ssl_cipher_list;
297302
unsigned int timeout;
303+
std::string proxy;
304+
unsigned int proxy_auth;
305+
unsigned int proxy_port;
306+
std::string proxy_userpwd;
307+
xmlrpc_httpproxytype proxy_type;
298308
} value;
299309
struct {
300310
bool network_interface;
@@ -317,6 +327,11 @@ class clientXmlTransport_curl : public xmlrpc_c::clientXmlTransport_http {
317327
bool egdsocket;
318328
bool ssl_cipher_list;
319329
bool timeout;
330+
bool proxy;
331+
bool proxy_auth;
332+
bool proxy_port;
333+
bool proxy_userpwd;
334+
bool proxy_type;
320335
} present;
321336
};
322337

include/xmlrpc-c/util.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
55
This is the interface to the libxmlrpc_util library, which contains
66
utility routines that have nothing to do with XML-RPC. The library
7-
exists because other Xmlrpc-c libraries use the utilities.
7+
exists primarily because other Xmlrpc-c libraries use the utilities,
8+
but the utilities are also documented for use by Xmlrpc-c users.
9+
For use by Xmlrpc-c users, they are considered to be part of the
10+
libxmlrpc library. libxmlrpc_util is a prerequisite of libxmlrpc.
811
912
By Bryan Henderson, San Jose, CA 05.09.21.
1013
@@ -140,7 +143,7 @@ void
140143
xmlrpc_set_fault_formatted_v(xmlrpc_env * const envP,
141144
int const code,
142145
const char * const format,
143-
va_list const args);
146+
va_list args);
144147

145148
/* The same as the above, but using a printf-style format string. */
146149
void

0 commit comments

Comments
 (0)