axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From din...@apache.org
Subject svn commit: r522098 - in /webservices/axis2/trunk/c: include/ modules/core/transport/http/sender/ modules/core/transport/http/sender/libcurl/ modules/core/transport/http/server/apache2/ samples/server/echo/
Date Sat, 24 Mar 2007 19:47:35 GMT
Author: dinesh
Date: Sat Mar 24 12:47:34 2007
New Revision: 522098

URL: http://svn.apache.org/viewvc?view=rev&rev=522098
Log:
fixed axis2c-378, this keep alive issue solved only with libcurl transport

Modified:
    webservices/axis2/trunk/c/include/axis2_http_transport.h
    webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c
    webservices/axis2/trunk/c/modules/core/transport/http/sender/libcurl/axis2_libcurl.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/Makefile.am
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c
    webservices/axis2/trunk/c/samples/server/echo/echo.c

Modified: webservices/axis2/trunk/c/include/axis2_http_transport.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport.h?view=diff&rev=522098&r1=522097&r2=522098
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Sat Mar 24 12:47:34 2007
@@ -131,6 +131,7 @@
  * HEADER_CONTENT_TYPE
  */
 #define AXIS2_HTTP_HEADER_CONTENT_TYPE "Content-Type"
+#define AXIS2_HTTP_HEADER_CONTENT_TYPE_ "Content-Type:"
 
 /**
  *USER DEFINED HEADER CONTENT TYPE
@@ -154,6 +155,8 @@
  */
 #define AXIS2_HTTP_HEADER_CONTENT_LENGTH "Content-Length"
 
+#define AXIS2_HTTP_HEADER_CONTENT_LENGTH_ "Content-Length:"
+
 /**
  * HEADER_CONTENT_LOCATION
  */
@@ -168,6 +171,7 @@
  * HEADER_SOAP_ACTION
  */
 #define AXIS2_HTTP_HEADER_SOAP_ACTION "SOAPAction"
+#define AXIS2_HTTP_HEADER_SOAP_ACTION_ "SOAPAction:"
 
 /**
  * HEADER_AUTHORIZATION
@@ -194,6 +198,14 @@
  */
 #define AXIS2_HTTP_HEADER_USER_AGENT "User-Agent"
 
+/**
+ * HEADER_USER_AGENT_AXIS2C
+ */
+#define AXIS2_HTTP_HEADER_USER_AGENT_AXIS2C "User-Agent:Axis2/C"
+
+#define AXIS2_HTTP_HEADER_ACCEPT_ "Accept:"
+
+#define AXIS2_HTTP_HEADER_EXPECT_ "Expect:"
 /**
  * HEADER_CACHE_CONTROL
  */

Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c?view=diff&rev=522098&r1=522097&r2=522098
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/http_sender.c Sat Mar 24
12:47:34 2007
@@ -1090,7 +1090,7 @@
     const axis2_char_t *str_url,
     const axis2_char_t *soap_action)
 {
-	axis2_http_sender_impl_t *sender_impl =  AXIS2_INTF_TO_IMPL(sender);
+    axis2_http_sender_impl_t *sender_impl = AXIS2_INTF_TO_IMPL(sender);
 	return axis2_libcurl_send (sender_impl->om_output, env, msg_ctx, out, str_url, soap_action);
 }
 #endif

Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/libcurl/axis2_libcurl.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/libcurl/axis2_libcurl.c?view=diff&rev=522098&r1=522097&r2=522098
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/libcurl/axis2_libcurl.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/libcurl/axis2_libcurl.c Sat
Mar 24 12:47:34 2007
@@ -19,6 +19,9 @@
 #include <axis2_http_transport.h>
 #include "libcurl_stream.h"
 
+static int ref = 0;
+static CURL *handler;
+
 typedef struct axis2_libcurl
 {
 	axis2_char_t *memory;
@@ -47,8 +50,9 @@
 
 void
 axis2_libcurl_free (
-	const axis2_env_t *env, 
-	axis2_libcurl_t *curl);
+	void *curl,
+	const axis2_env_t *env);
+
 
 
 axis2_status_t AXIS2_CALL
@@ -60,8 +64,6 @@
     const axis2_char_t *str_url,
     const axis2_char_t *soap_action)
 {
-
-	CURL *handler;
 	struct curl_slist *headers = NULL;
 	axiom_soap_body_t *soap_body;
 	axis2_bool_t is_soap = AXIS2_TRUE;
@@ -75,12 +77,11 @@
 	axis2_char_t *buffer = NULL;
 	unsigned int buffer_size = 0;
 	axis2_char_t *content_type;
-	axis2_char_t *content_len = "Content-Length:";
+	axis2_char_t *content_len = AXIS2_HTTP_HEADER_CONTENT_LENGTH_;
 	const axis2_char_t *char_set_enc = NULL;
-	axis2_char_t *content = "Content-Type:";
-	axis2_char_t *soap_action_header = "SOAPAction:";
+	axis2_char_t *content = AXIS2_HTTP_HEADER_CONTENT_TYPE_;
+	axis2_char_t *soap_action_header = AXIS2_HTTP_HEADER_SOAP_ACTION_;
 	axis2_libcurl_t *data;
-	axis2_libcurl_t *header;
 	axis2_stream_t *in_stream;
 	axis2_property_t *trans_in_property;
 	axis2_string_t *char_set_enc_str;
@@ -88,11 +89,19 @@
     int output_stream_size = 0;
 
 	data = axis2_libcurl_create (env);
-	header = axis2_libcurl_create (env);
-	handler = curl_easy_init ();
-	headers = curl_slist_append (headers, "User-Agent:Axis2/C");
-	headers = curl_slist_append (headers, "Accept:");
-	headers = curl_slist_append (headers, "Expect:");
+    if (!ref)
+    {
+        handler = curl_easy_init ();
+        ref ++;
+    }
+    else
+    {
+        curl_easy_reset (handler);
+    }
+	headers = curl_slist_append (headers, AXIS2_HTTP_HEADER_USER_AGENT_AXIS2C);
+	headers = curl_slist_append (headers,  AXIS2_HTTP_HEADER_ACCEPT_);
+	headers = curl_slist_append (headers, AXIS2_HTTP_HEADER_EXPECT_);
+
     if (AXIS2_TRUE ==  axis2_msg_ctx_get_doing_rest(msg_ctx, env))
 		is_soap = AXIS2_FALSE;
 	else
@@ -101,7 +110,7 @@
 	if (!is_soap)
 	{
 		soap_body = axiom_soap_envelope_get_body(out, env);
-        if (! soap_body)
+        if (!soap_body)
         {
             AXIS2_ERROR_SET(env->error,
 							AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
@@ -111,7 +120,7 @@
             return AXIS2_FAILURE;
         }
         body_node = axiom_soap_body_get_base_node(soap_body, env);
-        if (! body_node)
+        if (!body_node)
         {
             return AXIS2_FAILURE;
         }
@@ -119,9 +128,11 @@
 
 		method = (axis2_property_t *) axis2_msg_ctx_get_property(msg_ctx, env,
             AXIS2_HTTP_METHOD);
+
 		if (method)
+        {
 			method_value = (axis2_char_t *) axis2_property_get_value (method, env);
-
+        }
 		/* The default is POST */
 		if (method_value && 0 == axis2_strcmp(method_value, AXIS2_HTTP_HEADER_GET))
 		{
@@ -289,11 +300,11 @@
 	curl_easy_setopt (handler, CURLOPT_HTTPHEADER, headers);
 	curl_easy_setopt (handler, CURLOPT_WRITEFUNCTION, axis2_libcurl_write_memory_callback);
 	curl_easy_setopt (handler, CURLOPT_WRITEDATA, data);
-	curl_easy_setopt (handler, CURLOPT_HEADERFUNCTION, axis2_libcurl_header_callback);
-	curl_easy_setopt (handler, CURLOPT_WRITEHEADER, header);
+/* 	curl_easy_setopt (handler, CURLOPT_HEADERFUNCTION, axis2_libcurl_header_callback); */
+/* 	curl_easy_setopt (handler, CURLOPT_WRITEHEADER, header); */
 	curl_easy_perform (handler);
-	curl_slist_free_all (headers);
-	curl_easy_cleanup (handler);
+/* 	curl_slist_free_all (headers); */
+/* 	curl_easy_cleanup (handler); */
 
 	in_stream = axis2_stream_create_libcurl (env, data->memory, data->size);
     trans_in_property = axis2_property_create(env);
@@ -352,7 +363,9 @@
 }
 
 void
-axis2_libcurl_free (const axis2_env_t *env, axis2_libcurl_t *curl)
+axis2_libcurl_free (void *curl, const axis2_env_t *env)
 {
 	AXIS2_FREE (env->allocator, curl);
+/* 	curl_slist_free_all (headers); */
+/* 	curl_easy_cleanup (handler); */
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/Makefile.am?view=diff&rev=522098&r1=522097&r2=522098
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/Makefile.am Sat Mar
24 12:47:34 2007
@@ -11,6 +11,7 @@
 		     $(top_builddir)/modules/core/engine/libaxis2_engine.la\
 		     $(top_builddir)/util/src/libaxis2_util.la \
 		     $(top_builddir)/modules/core/transport/http/util/libaxis2_http_util.la\
+		     $(top_builddir)/modules/core/transport/http/common/libaxis2_http_common.la\
 		     $(top_builddir)/axiom/src/parser/$(WRAPPER_DIR)/libaxis2_parser.la\
                     -lpthread \
                     -L$(top_builddir)$(GUTHTHILA_LIBS) \

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c?view=diff&rev=522098&r1=522097&r2=522098
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c
(original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c
Sat Mar 24 12:47:34 2007
@@ -149,3 +149,7 @@
     return out_transport_info;
 }
 
+
+
+
+

Modified: webservices/axis2/trunk/c/samples/server/echo/echo.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/samples/server/echo/echo.c?view=diff&rev=522098&r1=522097&r2=522098
==============================================================================
--- webservices/axis2/trunk/c/samples/server/echo/echo.c (original)
+++ webservices/axis2/trunk/c/samples/server/echo/echo.c Sat Mar 24 12:47:34 2007
@@ -99,3 +99,7 @@
     return echo_om_node;
 }
 
+
+
+
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message