axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r389990 - in /webservices/axis2/trunk/c: modules/core/clientapi/async_result.c modules/core/clientapi/call.c modules/core/clientapi/stub.c modules/core/transport/http/http_status_line.c samples/client/echo_non_blocking/echo_client.c
Date Thu, 30 Mar 2006 05:11:20 GMT
Author: samisa
Date: Wed Mar 29 21:11:15 2006
New Revision: 389990

URL: http://svn.apache.org/viewcvs?rev=389990&view=rev
Log:
Fixed more client side leaks

Modified:
    webservices/axis2/trunk/c/modules/core/clientapi/async_result.c
    webservices/axis2/trunk/c/modules/core/clientapi/call.c
    webservices/axis2/trunk/c/modules/core/clientapi/stub.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c
    webservices/axis2/trunk/c/samples/client/echo_non_blocking/echo_client.c

Modified: webservices/axis2/trunk/c/modules/core/clientapi/async_result.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/async_result.c?rev=389990&r1=389989&r2=389990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/async_result.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/async_result.c Wed Mar 29 21:11:15 2006
@@ -130,6 +130,12 @@
         async_result_impl->async_result.ops = NULL;
     }
     
+    if (async_result_impl->result)
+    {
+        AXIS2_MSG_CTX_FREE(async_result_impl->result, env);
+        async_result_impl->result = NULL;
+    }
+    
     AXIS2_FREE((*env)->allocator, async_result_impl);
     async_result_impl = NULL;
     

Modified: webservices/axis2/trunk/c/modules/core/clientapi/call.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/call.c?rev=389990&r1=389989&r2=389990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/call.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/call.c Wed Mar 29 21:11:15 2006
@@ -62,6 +62,8 @@
     axis2_msg_ctx_t *last_res_msg_ctx;
     /* used to hold the service created in assume service */
     axis2_svc_t *axis_svc_private;
+    /* to hold the locally created async result */
+    axis2_async_result_t *async_result;
 
 } axis2_call_impl_t;
 
@@ -212,6 +214,7 @@
     call_impl->last_res_msg_ctx = NULL;
     call_impl->svc_ctx = NULL;
     call_impl->axis_svc_private = NULL;
+    call_impl->async_result = NULL;
     
     if(svc_ctx)
     {
@@ -296,6 +299,12 @@
         call_impl->callback_recv = NULL;
     }   
 
+    if (call_impl->async_result)
+    {
+        AXIS2_ASYNC_RESULT_FREE(call_impl->async_result, env);
+        call_impl->callback_recv = NULL;
+    }   
+
     if (call_impl->last_res_msg_ctx)
     {
         AXIS2_MSG_CTX_FREE(call_impl->last_res_msg_ctx, env);
@@ -402,7 +411,6 @@
         AXIS2_FREE((*env)->allocator, message_id);
         message_id = NULL;
     }
-
    
     if (call_impl->use_separate_listener) 
     {
@@ -555,6 +563,12 @@
     message_id = axis2_uuid_gen(env);
     AXIS2_MSG_CTX_SET_MESSAGE_ID(msg_ctx, env, message_id);
     
+    if(NULL != message_id)
+    {
+        AXIS2_FREE((*env)->allocator, message_id);
+        message_id = NULL;
+    }
+    
     if (call_impl->use_separate_listener) 
     {
         axis2_relates_to_t *relates_to = NULL;
@@ -642,6 +656,12 @@
 #endif
     }
 
+    if (engine)
+    {
+        AXIS2_ENGINE_FREE(engine, env);
+        engine = NULL;
+    }
+
     return AXIS2_SUCCESS;
 }
 
@@ -846,7 +866,6 @@
     axis2_call_worker_func_args_t *args_list = NULL;
     axis2_op_ctx_t *op_ctx = NULL;
     axis2_msg_ctx_t *response = NULL;
-    axis2_async_result_t *async_result = NULL;
     
     args_list = (axis2_call_worker_func_args_t *) data;
     if (!args_list)
@@ -862,8 +881,8 @@
 
     /* send the request and wait for reponse */
     response = axis2_two_way_send(args_list->env, args_list->msg_ctx);
-    async_result = axis2_async_result_create(args_list->env, response);
-    AXIS2_CALLBACK_INVOKE_ON_COMPLETE(args_list->callback, args_list->env, async_result);
+    args_list->call_impl->async_result = axis2_async_result_create(args_list->env,
response);
+    AXIS2_CALLBACK_INVOKE_ON_COMPLETE(args_list->callback, args_list->env, args_list->call_impl->async_result);
     AXIS2_CALLBACK_SET_COMPLETE(args_list->callback, args_list->env, AXIS2_TRUE);
     
     return NULL; 

Modified: webservices/axis2/trunk/c/modules/core/clientapi/stub.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/stub.c?rev=389990&r1=389989&r2=389990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/stub.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/stub.c Wed Mar 29 21:11:15 2006
@@ -50,6 +50,9 @@
      */
     axis2_bool_t maintain_session;
     axis2_char_t *current_session_id;
+
+    /* keep track of locally created endpoint to free it*/
+    axis2_endpoint_ref_t *endpoint_ref;
     	
 } axis2_stub_impl_t;
 
@@ -201,6 +204,7 @@
     stub_impl->maintain_session = AXIS2_FALSE;
     stub_impl->current_session_id = NULL;
     stub_impl->stub.ops = NULL;
+    stub_impl->endpoint_ref = NULL;
     
     stub_impl->sender_transport = AXIS2_STRDUP(AXIS2_TRANSPORT_HTTP, env);
     if(!stub_impl->sender_transport)
@@ -315,6 +319,7 @@
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;  
     }
+    stub_impl->endpoint_ref = endpoint_ref;
     
     return &(stub_impl->stub);
 }
@@ -353,6 +358,12 @@
     {
         AXIS2_ARRAY_LIST_FREE(stub_impl->modules, env);
         stub_impl->modules = NULL;
+    }
+    
+    if (stub_impl->endpoint_ref)
+    {
+        AXIS2_ENDPOINT_REF_FREE(stub_impl->endpoint_ref, env);
+        stub_impl->endpoint_ref = NULL;
     }
     
     if(stub_impl)

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c?rev=389990&r1=389989&r2=389990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c Wed Mar 29 21:11:15
2006
@@ -86,6 +86,7 @@
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
 	}
+    status_line_impl->status_line.ops = NULL;
     status_line_impl->line = (axis2_char_t *)AXIS2_STRDUP(str, env);
     status_line_impl->http_version = NULL;
     status_line_impl->reason_phrase = NULL;

Modified: webservices/axis2/trunk/c/samples/client/echo_non_blocking/echo_client.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/samples/client/echo_non_blocking/echo_client.c?rev=389990&r1=389989&r2=389990&view=diff
==============================================================================
--- webservices/axis2/trunk/c/samples/client/echo_non_blocking/echo_client.c (original)
+++ webservices/axis2/trunk/c/samples/client/echo_non_blocking/echo_client.c Wed Mar 29 21:11:15
2006
@@ -144,6 +144,7 @@
     
     AXIS2_CALL_INVOKE_NON_BLOCKING(call, &env, op, msg_ctx, callback);
 
+    printf("Non blocking call invoked\n");
   
     printf("\n");
     while (!AXIS2_CALLBACK_GET_COMPLETE(callback, &env))
@@ -155,13 +156,9 @@
         
     }
 
-    /*if (response_ctx)
-    {*/
-        soap_envelope = AXIS2_CALLBACK_GET_ENVELOPE(callback, &env);
-        if (soap_envelope)
-            ret_node = AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(soap_envelope, &env);
-    /*}*/
-
+    soap_envelope = AXIS2_CALLBACK_GET_ENVELOPE(callback, &env);
+    if (soap_envelope)
+        ret_node = AXIS2_SOAP_ENVELOPE_GET_BASE_NODE(soap_envelope, &env);
                                                         
     if(ret_node)
     {
@@ -176,6 +173,8 @@
         AXIS2_OM_NODE_SERIALIZE (ret_node, &env, om_output);
         buffer = AXIS2_XML_WRITER_GET_XML(writer, &env);
         printf ("\nReceived OM node in XML : %s\n", buffer);
+        AXIS2_OM_OUTPUT_FREE(om_output, &env);
+        AXIS2_FREE(env->allocator, buffer);
     }
     else
     {
@@ -214,13 +213,14 @@
 
     AXIS2_OM_ELEMENT_SET_TEXT(text_om_ele, env, "echo5", text_om_node);
     
-    
     xml_writer = axis2_xml_writer_create_for_memory(env, NULL, AXIS2_FALSE, AXIS2_FALSE);
     om_output = axis2_om_output_create( env, xml_writer);
     
     AXIS2_OM_NODE_SERIALIZE(echo_om_node, env, om_output);
     buffer = AXIS2_XML_WRITER_GET_XML(xml_writer, env);         
     printf("\nSending OM node in XML : %s \n",  buffer); 
+    AXIS2_OM_OUTPUT_FREE(om_output, env);
+    AXIS2_FREE((*env)->allocator, buffer);
 
     return echo_om_node;
 }



Mime
View raw message