diff options
Diffstat (limited to 'libcsoap')
-rw-r--r-- | libcsoap/soap-client.c | 25 | ||||
-rw-r--r-- | libcsoap/soap-client.h | 13 | ||||
-rw-r--r-- | libcsoap/soap-server.c | 4 |
3 files changed, 30 insertions, 12 deletions
diff --git a/libcsoap/soap-client.c b/libcsoap/soap-client.c index 58886ff..5562399 100644 --- a/libcsoap/soap-client.c +++ b/libcsoap/soap-client.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-client.c,v 1.8 2004/10/15 13:33:13 snowdrop Exp $ +* $Id: soap-client.c,v 1.9 2004/10/20 14:17:36 snowdrop Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -25,9 +25,21 @@ #include <nanohttp/nanohttp-client.h> #include <string.h> -/*--------------------------------- */ +/*--------------------------------- */
+static int _block_socket = 0; static SoapEnv *_soap_client_build_result(hresponse_t *res); /*--------------------------------- */ +
+void soap_client_block_socket(int block)
+{
+ _block_socket = block;
+}
+
+int soap_client_get_blockmode()
+{
+ return _block_socket;
+}
+
int soap_client_init_args(int argc, char *argv[]) @@ -79,8 +91,6 @@ soap_client_invoke(SoapCtx *call, const char *url, const char *soap_action) static int counter=1; part_t *part; int file_count=0; - long total_size; - long file_size; /* Create buffer */ buffer = xmlBufferCreate(); @@ -88,7 +98,8 @@ soap_client_invoke(SoapCtx *call, const char *url, const char *soap_action) content = (char*)xmlBufferContent(buffer); /* Transport via HTTP */ - conn = httpc_new(); + conn = httpc_new();
+ conn->block = soap_client_get_blockmode(); /* Set soap action */ if (soap_action != NULL) { @@ -224,9 +235,7 @@ soap_client_invoke(SoapCtx *call, const char *url, const char *soap_action) static SoapEnv* _soap_client_build_result(hresponse_t *res) { - xmlDocPtr doc; SoapEnv *env; - char *buffer; log_verbose2("Building result (%p)", res); @@ -252,7 +261,7 @@ SoapEnv* _soap_client_build_result(hresponse_t *res) env = soap_env_new_from_stream(res->in); if (env == NULL) { - xmlFreeDoc(doc); +/* xmlFreeDoc(doc);*/ return soap_env_new_with_fault(Fault_Client, "Can not create envelope","",""); } diff --git a/libcsoap/soap-client.h b/libcsoap/soap-client.h index 439a96d..6820c14 100644 --- a/libcsoap/soap-client.h +++ b/libcsoap/soap-client.h @@ -1,5 +1,5 @@ /******************************************************************
- * $Id: soap-client.h,v 1.4 2004/10/15 13:33:13 snowdrop Exp $
+ * $Id: soap-client.h,v 1.5 2004/10/20 14:17:36 snowdrop Exp $
*
* CSOAP Project: A SOAP client/server library in C
* Copyright (C) 2003 Ferhat Ayaz
@@ -52,6 +52,17 @@ SoapCtx* soap_client_invoke(SoapCtx *ctx, SoapCtx *soap_client_ctx_new(const char *urn, const char *method);
+/**
+ Sets the underlaying socket to use while connecting
+ into block mode or not block mode.
+ The default mode is always non-blocking mode.
+
+ @param block 1 to creat blocked sockets, 0 to create non
+ blocking sockets.
+*/
+void soap_client_block_socket(int block);
+int soap_client_get_blockmode();
+
#endif
diff --git a/libcsoap/soap-server.c b/libcsoap/soap-server.c index 5fb4efe..690fa6b 100644 --- a/libcsoap/soap-server.c +++ b/libcsoap/soap-server.c @@ -1,5 +1,5 @@ /****************************************************************** -* $Id: soap-server.c,v 1.5 2004/10/15 13:33:13 snowdrop Exp $ +* $Id: soap-server.c,v 1.6 2004/10/20 14:17:36 snowdrop Exp $ * * CSOAP Project: A SOAP client/server library in C * Copyright (C) 2003 Ferhat Ayaz @@ -107,11 +107,9 @@ void soap_server_destroy() void soap_server_entry(httpd_conn_t *conn, hrequest_t *req) { hpair_t *header = NULL; - char *postdata; char buffer[1054]; char urn[150]; char method[150]; - long received; SoapCtx *ctx, *ctxres; SoapRouter *router; SoapService *service; |