summaryrefslogtreecommitdiffstats
path: root/libcsoap
diff options
context:
space:
mode:
authorGravatar snowdrop2006-02-08 11:13:13 +0000
committerGravatar snowdrop2006-02-08 11:13:13 +0000
commitc4286ea5287279836c5ef49a06153db95429bfe6 (patch)
tree1ace3f15224374a6350b028b2fe50d34072f5f87 /libcsoap
parent1340ec27d42648e84878abe2d2f0b6f23ca24d82 (diff)
downloadcsoap-c4286ea5287279836c5ef49a06153db95429bfe6.tar.gz
csoap-c4286ea5287279836c5ef49a06153db95429bfe6.tar.bz2
the attached patches address the following issues:
* query the port the server is listening on {soap_server,httpd}_get_port * the possibility to add a default service via httpd_register_default * remove some compiler warnings (on FreeBSD pthread_t is a pointer to a struct pthread, on Linux it is a (unsigned?) long int) tschuess, Heiko
Diffstat (limited to 'libcsoap')
-rw-r--r--libcsoap/soap-client.c20
-rw-r--r--libcsoap/soap-server.c96
-rw-r--r--libcsoap/soap-server.h3
-rw-r--r--libcsoap/soap-xml.c4
4 files changed, 51 insertions, 72 deletions
diff --git a/libcsoap/soap-client.c b/libcsoap/soap-client.c
index f7c38c2..55fa6ca 100644
--- a/libcsoap/soap-client.c
+++ b/libcsoap/soap-client.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: soap-client.c,v 1.21 2006/01/10 11:29:04 snowdrop Exp $
+* $Id: soap-client.c,v 1.22 2006/02/08 11:13:14 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -42,8 +42,6 @@ soap_client_get_blockmode()
return _block_socket;
}
-
-
herror_t
soap_client_init_args(int argc, char *argv[])
{
@@ -58,22 +56,6 @@ soap_client_destroy()
httpc_destroy();
}
-static long
-_file_get_size(const char *filename)
-{
- FILE *f = fopen(filename, "r");
- long size;
-
- if (!f)
- return -1;
-
- fseek(f, 0, SEEK_END);
- size = ftell(f);
- fclose(f);
- return size;
-}
-
-
herror_t
soap_client_invoke(SoapCtx * call, SoapCtx ** response, const char *url,
const char *soap_action)
diff --git a/libcsoap/soap-server.c b/libcsoap/soap-server.c
index 4f55bf5..af1d808 100644
--- a/libcsoap/soap-server.c
+++ b/libcsoap/soap-server.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: soap-server.c,v 1.15 2006/01/27 20:23:40 mrcsys Exp $
+* $Id: soap-server.c,v 1.16 2006/02/08 11:13:14 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -37,15 +37,9 @@ typedef struct _SoapRouterNode
SoapRouterNode *head = NULL;
SoapRouterNode *tail = NULL;
-static
- SoapRouterNode *router_node_new(SoapRouter * router,
- const char *context, SoapRouterNode * next);
-
-static SoapRouter *router_find(const char *context);
-
+/*---------------------------------*/
static void _soap_server_send_ctx(httpd_conn_t * conn, SoapCtx * ctxres);
-/*---------------------------------*/
void soap_server_entry(httpd_conn_t * conn, hrequest_t * req);
static void _soap_server_send_env(http_output_stream_t * out, SoapEnv * env);
static
@@ -53,6 +47,46 @@ static
const char *errmsg);
/*---------------------------------*/
+static SoapRouterNode *
+router_node_new(SoapRouter * router,
+ const char *context, SoapRouterNode * next)
+{
+ SoapRouterNode *node;
+ const char *noname = "/lost_found";
+
+ node = (SoapRouterNode *) malloc(sizeof(SoapRouterNode));
+ if (context)
+ {
+ node->context = (char *) malloc(strlen(context) + 1);
+ strcpy(node->context, context);
+ }
+ else
+ {
+ log_warn2("context is null. Using '%s'", noname);
+ node->context = (char *) malloc(strlen(noname) + 1);
+ strcpy(node->context, noname);
+ }
+
+ node->router = router;
+ node->next = next;
+
+ return node;
+}
+
+static SoapRouter *
+router_find(const char *context)
+{
+ SoapRouterNode *node = head;
+
+ while (node != NULL)
+ {
+ if (!strcmp(node->context, context))
+ return node->router;
+ node = node->next;
+ }
+
+ return NULL;
+}
herror_t
soap_server_init_args(int argc, char *argv[])
@@ -90,6 +124,11 @@ soap_server_run()
return httpd_run();
}
+int
+soap_server_get_port(void)
+{
+ return httpd_get_port();
+}
void
soap_server_destroy()
@@ -390,44 +429,3 @@ _soap_server_send_fault(httpd_conn_t * conn, hpair_t * header,
-static SoapRouterNode *
-router_node_new(SoapRouter * router,
- const char *context, SoapRouterNode * next)
-{
- SoapRouterNode *node;
- const char *noname = "/lost_found";
-
- node = (SoapRouterNode *) malloc(sizeof(SoapRouterNode));
- if (context)
- {
- node->context = (char *) malloc(strlen(context) + 1);
- strcpy(node->context, context);
- }
- else
- {
- log_warn2("context is null. Using '%s'", noname);
- node->context = (char *) malloc(strlen(noname) + 1);
- strcpy(node->context, noname);
- }
-
- node->router = router;
- node->next = next;
-
- return node;
-}
-
-
-static SoapRouter *
-router_find(const char *context)
-{
- SoapRouterNode *node = head;
-
- while (node != NULL)
- {
- if (!strcmp(node->context, context))
- return node->router;
- node = node->next;
- }
-
- return NULL;
-}
diff --git a/libcsoap/soap-server.h b/libcsoap/soap-server.h
index 9306f1a..4e2db62 100644
--- a/libcsoap/soap-server.h
+++ b/libcsoap/soap-server.h
@@ -1,5 +1,5 @@
/******************************************************************
- * $Id: soap-server.h,v 1.7 2006/01/10 11:29:04 snowdrop Exp $
+ * $Id: soap-server.h,v 1.8 2006/02/08 11:13:14 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -70,6 +70,7 @@ int soap_server_register_router(SoapRouter * router, const char *context);
*/
herror_t soap_server_run();
+int soap_server_get_port(void);
/**
Frees the soap server.
diff --git a/libcsoap/soap-xml.c b/libcsoap/soap-xml.c
index 7b6ba87..62b0b7d 100644
--- a/libcsoap/soap-xml.c
+++ b/libcsoap/soap-xml.c
@@ -1,5 +1,5 @@
/******************************************************************
-* $Id: soap-xml.c,v 1.8 2006/01/10 11:29:04 snowdrop Exp $
+* $Id: soap-xml.c,v 1.9 2006/02/08 11:13:14 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -23,8 +23,6 @@
******************************************************************/
#include <libcsoap/soap-xml.h>
-static const char *soap_env_ns = "http://schemas.xmlsoap.org/soap/envelope/";
-
xmlNodePtr
soap_xml_get_children(xmlNodePtr param)
{