ws-sandesha-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r682784 - in /webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008: include/ samples/RMSampleService/ src/core/ src/msgprocessors/ src/storage/sqlite/ src/util/ src/wsrm/
Date Tue, 05 Aug 2008 16:39:53 GMT
Author: damitha
Date: Tue Aug  5 09:39:52 2008
New Revision: 682784

URL: http://svn.apache.org/viewvc?rev=682784&view=rev
Log:
Fixing memory leaks. Now client samples have zero memory leaks. Also server have 0 leaks for rm_echo_single_1_0.
But server has still few leaks for rm_ping_1_0 requests.

Modified:
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_fault_mgr.h
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc_skel.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/core/sandesha2_msg_ctx.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_msg_processor.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/fault_mgr.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_init.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/seq_mgr.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/accept.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/ack_requested.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/acks_to.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/address.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq_res.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/create_seq_res.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/identifier.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/rm_elements.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq.c
    webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq_res.c

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_fault_mgr.h
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_fault_mgr.h?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_fault_mgr.h (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_fault_mgr.h Tue Aug  5 09:39:52 2008
@@ -46,7 +46,7 @@
 sandesha2_msg_ctx_t* AXIS2_CALL 
 sandesha2_fault_mgr_check_for_create_seq_refused(
     const axutil_env_t *env,
-    axis2_msg_ctx_t *create_seq_msg,
+    sandesha2_msg_ctx_t *rm_create_seq_msg_ctx,
     sandesha2_seq_property_mgr_t *seq_prop_mgr);
         
 sandesha2_msg_ctx_t* AXIS2_CALL 

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc.c Tue Aug  5 09:39:52 2008
@@ -52,16 +52,13 @@
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_SVC_SKEL_INPUT_OM_NODE_NULL, AXIS2_FAILURE);
         return NULL;
     }
-    /*element = axiom_node_get_data_element(node, env);
-    qname = axutil_qname_create(env, "Text", ns, NULL);
-    text_parent_element = axiom_element_get_first_child_with_qname(element, env, 
-            qname, node, &text_parent_node);
-    axutil_qname_free(qname, env);*/
+
     text_parent_node = axiom_node_get_first_element(node, env);
     if (!text_parent_node) /* 'text' node */
     {
         AXIS2_ERROR_SET(env->error, 
             AXIS2_ERROR_SVC_SKEL_INVALID_XML_FORMAT_IN_REQUEST, AXIS2_FAILURE);
+
         return NULL;
     }
     
@@ -105,12 +102,6 @@
     
     ns1 = axiom_namespace_create (env, "http://tempuri.org/", "ns1");
 
-    echo_om_ele = axiom_element_create(env, NULL, "echoString", ns1, &echo_om_node);
-    
-    text_om_ele = axiom_element_create(env, echo_om_node, "text", NULL, &text_om_node);
-
-    axiom_element_set_text(text_om_ele, env, text, text_om_node);
-
     echo_om_ele = axiom_element_create(env, NULL, "echoStringResponse", ns1, &echo_om_node);
     text_om_ele = axiom_element_create(env, echo_om_node, "EchoStringReturn", ns1, &text_om_node);
     axiom_element_set_text(text_om_ele, env, text, text_om_node);

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc_skel.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc_skel.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc_skel.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/samples/RMSampleService/rm_sample_svc_skel.c Tue Aug  5 09:39:52 2008
@@ -64,11 +64,9 @@
 {
     axis2_svc_skeleton_t *svc_skeleton = NULL;
     /* Allocate memory for the structs */
-    svc_skeleton = AXIS2_MALLOC(env->allocator, 
-        sizeof(axis2_svc_skeleton_t));
+    svc_skeleton = AXIS2_MALLOC(env->allocator, sizeof(axis2_svc_skeleton_t));
 
-    svc_skeleton->ops = AXIS2_MALLOC(
-        env->allocator, sizeof(axis2_svc_skeleton_ops_t));
+    svc_skeleton->ops = AXIS2_MALLOC(env->allocator, sizeof(axis2_svc_skeleton_ops_t));
     svc_skeleton->ops = &rm_sample_svc_ops_var;
     svc_skeleton->func_array = NULL;
 
@@ -81,13 +79,6 @@
     axis2_svc_skeleton_t *svc_skeleton,
     const axutil_env_t *env)
 {
-    svc_skeleton->func_array = axutil_array_list_create(env, 0);
-    /* Add the implemented operation names of the service to  
-     * the array list of functions 
-     */
-    axutil_array_list_add(svc_skeleton->func_array, env, "echoString");
-    axutil_array_list_add(svc_skeleton->func_array, env, "ping");
-    axutil_array_list_add(svc_skeleton->func_array, env, "mtomSample");
     /* Any initialization stuff of echo service should go here */
     return AXIS2_SUCCESS;
 }
@@ -111,27 +102,37 @@
     {
         op_qname = (axutil_qname_t *)axis2_op_get_qname(op, env);
         if(op_qname)
+        {
             op_name = axutil_qname_get_localpart(op_qname, env);
+        }
+
         if(op_name)
         {
-            if (axutil_strcmp(op_name, "echoString") == 0)
+            if (!axutil_strcmp(op_name, "echoString"))
+            {
                 return rm_sample_svc_echo(env, node);
-            if (axutil_strcmp(op_name, "ping") == 0)
+            }
+            if (!axutil_strcmp(op_name, "ping"))
             {
                 rm_sample_svc_ping(env, node);
                 return NULL;
             }
-            if (axutil_strcmp(op_name, "mtomSample") == 0)
+            if (!axutil_strcmp(op_name, "mtomSample"))
+            {
                 return rm_sample_svc_mtom(env, node, msg_ctx);
+            }
         }
     }
+
     return NULL;
 }
 
 /* On fault, handle the fault */
 axiom_node_t* AXIS2_CALL
-rm_sample_svc_on_fault(axis2_svc_skeleton_t *svc_skeli, 
-              const axutil_env_t *env, axiom_node_t *node)
+rm_sample_svc_on_fault(
+    axis2_svc_skeleton_t *svc_skeli, 
+    const axutil_env_t *env, 
+    axiom_node_t *node)
 {
    /* Here we are just setting a simple error message inside an element 
     * called 'EchoServiceError' 
@@ -139,25 +140,17 @@
     axiom_node_t *error_node = NULL;
     axiom_node_t* text_node = NULL;
     axiom_element_t *error_ele = NULL;
-    error_ele = axiom_element_create(env, node, "EchoServiceError", NULL, 
-        &error_node);
-    axiom_element_set_text(error_ele, env, "Echo service failed ", 
-        text_node);
+    error_ele = axiom_element_create(env, node, "EchoServiceError", NULL, &error_node);
+    axiom_element_set_text(error_ele, env, "Echo service failed ", text_node);
     return error_node;
 }
 
 /* Free the resources used */
 int AXIS2_CALL
-rm_sample_svc_free(axis2_svc_skeleton_t *svc_skeleton,
-            const axutil_env_t *env)
+rm_sample_svc_free(
+    axis2_svc_skeleton_t *svc_skeleton,
+    const axutil_env_t *env)
 {
-    /* Free the function array */
-    if(svc_skeleton->func_array)
-    {
-        axutil_array_list_free(svc_skeleton->func_array, env);
-        svc_skeleton->func_array = NULL;
-    }
-    
     /* Free the service skeleton */
     if(svc_skeleton)
     {

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/core/sandesha2_msg_ctx.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/core/sandesha2_msg_ctx.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/core/sandesha2_msg_ctx.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/core/sandesha2_msg_ctx.c Tue Aug  5 09:39:52 2008
@@ -61,8 +61,7 @@
 {
     sandesha2_msg_ctx_t *rm_msg_ctx = NULL;
     
-    rm_msg_ctx =  (sandesha2_msg_ctx_t *)AXIS2_MALLOC 
-        (env->allocator, sizeof(sandesha2_msg_ctx_t));
+    rm_msg_ctx =  (sandesha2_msg_ctx_t *)AXIS2_MALLOC(env->allocator, sizeof(sandesha2_msg_ctx_t));
 	
     if(!rm_msg_ctx)
 	{
@@ -168,6 +167,7 @@
         sandesha2_ack_requested_free(rm_msg_ctx->ack_requested, env);
         rm_msg_ctx->ack_requested = NULL;
     }
+
 	AXIS2_FREE(env->allocator, rm_msg_ctx);
 	return AXIS2_SUCCESS;
 }
@@ -636,7 +636,13 @@
     sandesha2_create_seq_res_t *create_seq_res)
 {
     AXIS2_PARAM_CHECK(env->error, create_seq_res, AXIS2_FAILURE);
-    
+   
+    if(rm_msg_ctx->create_seq_res)
+    {
+        sandesha2_create_seq_res_free(rm_msg_ctx->create_seq_res, env);
+        rm_msg_ctx->create_seq_res = NULL;
+    }
+
     rm_msg_ctx->create_seq_res = create_seq_res;
     return AXIS2_SUCCESS;
 }

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/app_msg_processor.c Tue Aug  5 09:39:52 2008
@@ -251,7 +251,7 @@
     sandesha2_seq_property_bean_t *msgs_bean = NULL;
     long msg_no = 0;
     long highest_in_msg_no = 0;
-    axis2_char_t *msgs_str = "";
+    axis2_char_t *msgs_str = NULL;
     axis2_char_t msg_num_str[32];
     sandesha2_invoker_mgr_t *invoker_mgr = NULL;
     sandesha2_sender_mgr_t *sender_mgr = NULL;
@@ -602,7 +602,11 @@
         SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
     if(msgs_bean)
     {
-        msgs_str = axutil_strdup(env, sandesha2_seq_property_bean_get_value(msgs_bean, env));
+        axis2_char_t *temp_value = sandesha2_seq_property_bean_get_value(msgs_bean, env);
+        if(temp_value)
+        {
+            msgs_str = axutil_strdup(env, temp_value);
+        }
     }
     else
     {
@@ -610,10 +614,15 @@
         sandesha2_seq_property_bean_set_seq_id(msgs_bean, env, rmd_sequence_id);
         sandesha2_seq_property_bean_set_name(msgs_bean, env, 
             SANDESHA2_SEQ_PROP_SERVER_COMPLETED_MESSAGES);
-        sandesha2_seq_property_bean_set_value(msgs_bean, env, msgs_str);
+
+        sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, msgs_bean);
+    }
+
+    if(msgs_str)
+    {
+        msg_no_present_in_list = sandesha2_app_msg_processor_msg_num_is_in_list(env, msgs_str, msg_no);
     }
 
-    msg_no_present_in_list = sandesha2_app_msg_processor_msg_num_is_in_list(env, msgs_str, msg_no);
     if(msg_no_present_in_list && !axutil_strcmp(SANDESHA2_QOS_DEFAULT_INVOCATION_TYPE, 
                 SANDESHA2_QOS_EXACTLY_ONCE))
     {
@@ -622,7 +631,7 @@
 
     if(!msg_no_present_in_list)
     {
-        if(msgs_str && 0 < axutil_strlen(msgs_str))
+        if(msgs_str)
         {
             axis2_char_t *tmp_str = NULL;
 
@@ -634,6 +643,7 @@
         {
             msgs_str = axutil_strdup(env, msg_num_str);
         }
+
         sandesha2_seq_property_bean_set_value(msgs_bean, env, msgs_str);
         sandesha2_seq_property_mgr_update(seq_prop_mgr, env, msgs_bean);
     }
@@ -683,7 +693,11 @@
 
             seq_prop_bean = sandesha2_seq_property_bean_create_with_data(
                 env, rmd_sequence_id, SANDESHA2_SEQ_PROP_LAST_IN_MESSAGE_ID, msg_id);
-            sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, seq_prop_bean);
+            if(seq_prop_bean)
+            {
+                sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, seq_prop_bean);
+                sandesha2_seq_property_bean_free(seq_prop_bean, env);
+            }
         }
     }
     /* end test code */
@@ -1690,7 +1704,6 @@
     sandesha2_seq_property_mgr_t *seq_prop_mgr)
 {
     axis2_endpoint_ref_t *to_epr = NULL;
-    axis2_endpoint_ref_t *temp_to_epr = NULL;
     const axis2_char_t *reply_to_addr = NULL;
     sandesha2_seq_property_bean_t *acks_to_bean = NULL;
     axis2_char_t *acks_to_str = NULL;
@@ -1735,8 +1748,8 @@
         return AXIS2_FAILURE;
     }
 
-    temp_to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
-    if(temp_to_epr)
+    to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
+    /*if(temp_to_epr)
     {
         const axis2_char_t *temp_to_addr = NULL;
 
@@ -1745,7 +1758,7 @@
         {
             to_epr = axis2_endpoint_ref_create(env, temp_to_addr);
         }
-    }
+    }*/
 
     reply_to_epr = axis2_msg_ctx_get_reply_to(msg_ctx, env);
     if(reply_to_epr)
@@ -2413,6 +2426,10 @@
         {
             AXIS2_FREE(env->allocator, reply_to_addr);
         }
+        if(reply_to_epr)
+        {
+            axis2_endpoint_ref_free(reply_to_epr, env);
+        }
         if(rms_sequence_id)
         {
             AXIS2_FREE(env->allocator, rms_sequence_id);
@@ -2455,6 +2472,10 @@
             {
                 AXIS2_FREE(env->allocator, reply_to_addr);
             }
+            if(reply_to_epr)
+            {
+                axis2_endpoint_ref_free(reply_to_epr, env);
+            }
             if(rms_sequence_id)
             {
                 AXIS2_FREE(env->allocator, rms_sequence_id);
@@ -2598,6 +2619,16 @@
         engine = axis2_engine_create(env, conf_ctx);
         status = axis2_engine_resume_send(engine, env, app_msg_ctx);
 
+        if(rm_version)
+        {
+            AXIS2_FREE(env->allocator, rm_version);
+        }
+
+        if(app_msg_sender_bean)
+        {
+            sandesha2_sender_bean_free(app_msg_sender_bean, env);
+        }
+
         if(engine)
         {
             axis2_engine_free(engine, env);
@@ -2611,6 +2642,10 @@
         {
             AXIS2_FREE(env->allocator, reply_to_addr);
         }
+        if(reply_to_epr)
+        {
+            axis2_endpoint_ref_free(reply_to_epr, env);
+        }
 
         if(from_acks_to_addr)
         {
@@ -2659,6 +2694,10 @@
         {
             AXIS2_FREE(env->allocator, reply_to_addr);
         }
+        if(reply_to_epr)
+        {
+            axis2_endpoint_ref_free(reply_to_epr, env);
+        }
         if(from_acks_to_addr)
         {
             AXIS2_FREE(env->allocator, from_acks_to_addr);
@@ -2820,6 +2859,10 @@
         {
             AXIS2_FREE(env->allocator, reply_to_addr);
         }
+        if(reply_to_epr)
+        {
+            axis2_endpoint_ref_free(reply_to_epr, env);
+        }
         if(from_acks_to_addr)
         {
             AXIS2_FREE(env->allocator, from_acks_to_addr);
@@ -2842,6 +2885,11 @@
         AXIS2_FREE(env->allocator, reply_to_addr);
     }
 
+    if(reply_to_epr)
+    {
+        axis2_endpoint_ref_free(reply_to_epr, env);
+    }
+
     if(from_acks_to_addr)
     {
         AXIS2_FREE(env->allocator, from_acks_to_addr);

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_msg_processor.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_msg_processor.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_msg_processor.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/msgprocessors/create_seq_msg_processor.c Tue Aug  5 09:39:52 2008
@@ -163,7 +163,7 @@
     sandesha2_next_msg_mgr_t *next_msg_mgr = NULL;
     axutil_property_t *property = NULL;
     axis2_char_t *rmd_sequence_id = NULL;
-    sandesha2_msg_ctx_t *create_seq_res_msg = NULL;
+    sandesha2_msg_ctx_t *rm_create_seq_res_msg_ctx = NULL;
     sandesha2_create_seq_res_t *create_seq_res_part = NULL;
     sandesha2_seq_offer_t *seq_offer = NULL;
     axis2_endpoint_ref_t *acks_to = NULL;
@@ -203,7 +203,8 @@
     create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
     next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
     
-    fault_rm_msg_ctx = sandesha2_fault_mgr_check_for_create_seq_refused(env, create_seq_msg_ctx, seq_prop_mgr);
+    /*fault_rm_msg_ctx = sandesha2_fault_mgr_check_for_create_seq_refused(env, rm_msg_ctx, seq_prop_mgr);*/
+    fault_rm_msg_ctx = sandesha2_fault_mgr_check_for_create_seq_refused(env, rm_msg_ctx, seq_prop_mgr);
     if(fault_rm_msg_ctx)
     {
         axis2_engine_t *engine = NULL;
@@ -246,12 +247,12 @@
     rmd_sequence_id = sandesha2_seq_mgr_setup_new_rmd_sequence(env, rm_msg_ctx, seq_prop_mgr, 
             next_msg_mgr);
 
-    create_seq_res_msg = sandesha2_msg_creator_create_create_seq_res_msg(env, rm_msg_ctx, 
+    rm_create_seq_res_msg_ctx = sandesha2_msg_creator_create_create_seq_res_msg(env, rm_msg_ctx, 
             out_msg_ctx, rmd_sequence_id, seq_prop_mgr);
 
     axis2_msg_ctx_set_flow(out_msg_ctx, env, AXIS2_OUT_FLOW);
 
-    if(!create_seq_res_msg)
+    if(!rm_create_seq_res_msg_ctx)
     {
         if(rmd_sequence_id)
         {
@@ -279,10 +280,10 @@
     property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
 
     /* For making sure that this won't be processed again */
-    sandesha2_msg_ctx_set_property(create_seq_res_msg, env, SANDESHA2_APPLICATION_PROCESSING_DONE, 
-            property); 
+    sandesha2_msg_ctx_set_property(rm_create_seq_res_msg_ctx, env, 
+            SANDESHA2_APPLICATION_PROCESSING_DONE, property); 
     
-    create_seq_res_part = sandesha2_msg_ctx_get_create_seq_res(create_seq_res_msg, env);
+    create_seq_res_part = sandesha2_msg_ctx_get_create_seq_res(rm_create_seq_res_msg_ctx, env);
     seq_offer = sandesha2_create_seq_get_seq_offer(create_seq_part, env);
 
     /* Offer processing */ 
@@ -302,6 +303,11 @@
                     "[sandesha2] Accept part has not genereated for a message with offer");
             AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING, AXIS2_FAILURE);
 
+            if(rm_create_seq_res_msg_ctx)
+            {
+                sandesha2_msg_ctx_free(rm_create_seq_res_msg_ctx, env);
+            }
+
             if(rmd_sequence_id)
             {
                 AXIS2_FREE(env->allocator, rmd_sequence_id);
@@ -392,7 +398,7 @@
         }
         else
         {
-            sandesha2_msg_ctx_add_soap_envelope(create_seq_res_msg, env);
+            sandesha2_msg_ctx_add_soap_envelope(rm_create_seq_res_msg_ctx, env);
         }
     }
 
@@ -404,6 +410,11 @@
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2]Acks to is null");
         AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_INVALID_EPR, AXIS2_FAILURE);
 
+        if(rm_create_seq_res_msg_ctx)
+        {
+            sandesha2_msg_ctx_free(rm_create_seq_res_msg_ctx, env);
+        }
+
         if(rmd_sequence_id)
         {
             AXIS2_FREE(env->allocator, rmd_sequence_id);
@@ -430,6 +441,7 @@
     acks_to_bean = sandesha2_seq_property_bean_create_with_data(env, rmd_sequence_id, 
             SANDESHA2_SEQ_PROP_ACKS_TO_EPR, (axis2_char_t*)axis2_endpoint_ref_get_address(acks_to, 
                 env));
+
     if(acks_to_bean)
     {
         sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, acks_to_bean);
@@ -452,9 +464,15 @@
     if(out_msg_ctx)
     {
         axis2_core_utils_reset_out_msg_ctx(env, out_msg_ctx);
+        /*axis2_msg_ctx_reset_transport_out_stream(out_msg_ctx, env);*/
         axis2_msg_ctx_free(out_msg_ctx, env);
     }
 
+    if(rm_create_seq_res_msg_ctx)
+    {
+        sandesha2_msg_ctx_free(rm_create_seq_res_msg_ctx, env);
+    }
+
     to_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env, rmd_sequence_id, 
             SANDESHA2_SEQ_PROP_TO_EPR);
     if(!to_bean)

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/storage/sqlite/permanent_storage_mgr.c Tue Aug  5 09:39:52 2008
@@ -898,6 +898,7 @@
                     in_msg_store_key, in_msg_ctx);*/
 
             sandesha2_msg_store_bean_set_in_msg_store_key(bean, env, in_msg_store_key);
+            AXIS2_FREE(env->allocator, in_msg_store_key);
         }
     }
 

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/fault_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/fault_mgr.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/fault_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/fault_mgr.c Tue Aug  5 09:39:52 2008
@@ -36,44 +36,50 @@
 sandesha2_msg_ctx_t* AXIS2_CALL 
 sandesha2_fault_mgr_check_for_create_seq_refused (
     const axutil_env_t *env,
-    axis2_msg_ctx_t *create_seq_msg,
+    sandesha2_msg_ctx_t *rm_create_seq_msg_ctx,
     sandesha2_seq_property_mgr_t *seq_prop_mgr)
 {
-    sandesha2_msg_ctx_t *rm_msg_ctx = NULL;
     sandesha2_create_seq_t *create_seq = NULL;
     axis2_bool_t refuse_seq = AXIS2_FALSE;
     
-    AXIS2_PARAM_CHECK(env->error, create_seq_msg, NULL);
+    AXIS2_PARAM_CHECK(env->error, rm_create_seq_msg_ctx, NULL);
     AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, NULL);
     
-    rm_msg_ctx = sandesha2_msg_init_init_msg(env, create_seq_msg);
-    create_seq = sandesha2_msg_ctx_get_create_seq(rm_msg_ctx, env);
+    create_seq = sandesha2_msg_ctx_get_create_seq(rm_create_seq_msg_ctx, env);
     
-    if(NULL == create_seq)
+    if(!create_seq)
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING, 
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_REQD_MSG_PART_MISSING, AXIS2_FAILURE);
         return NULL;
     }
-    if(AXIS2_TRUE == refuse_seq)
+    if(refuse_seq)
     {
+        axiom_soap_envelope_t *soap_envelope = NULL;
         sandesha2_fault_data_t *fault_data = NULL;
+
         fault_data = sandesha2_fault_data_create(env);
         sandesha2_fault_data_set_type(fault_data, env, 
                         SANDESHA2_SOAP_FAULT_TYPE_CREATE_SEQ_REFUSED);
-        if(SANDESHA2_SOAP_VERSION_1_1 == sandesha2_utils_get_soap_version(env, 
-                        sandesha2_msg_ctx_get_soap_envelope(rm_msg_ctx, env)))
-            sandesha2_fault_data_set_code(fault_data, env, 
-                        AXIOM_SOAP11_FAULT_CODE_SENDER);
+
+        soap_envelope = sandesha2_msg_ctx_get_soap_envelope(rm_create_seq_msg_ctx, env);
+        if(SANDESHA2_SOAP_VERSION_1_1 == sandesha2_utils_get_soap_version(env, soap_envelope))
+        {
+            sandesha2_fault_data_set_code(fault_data, env, AXIOM_SOAP11_FAULT_CODE_SENDER);
+        }
         else
-            sandesha2_fault_data_set_code(fault_data, env, 
-                        AXIOM_SOAP12_FAULT_CODE_SENDER);
+        {
+            sandesha2_fault_data_set_code(fault_data, env, AXIOM_SOAP12_FAULT_CODE_SENDER);
+        }
+
         sandesha2_fault_data_set_sub_code(fault_data, env, 
-                        SANDESHA2_SOAP_FAULT_SUBCODE_CREATE_SEQ_REFUSED);
+                SANDESHA2_SOAP_FAULT_SUBCODE_CREATE_SEQ_REFUSED);
+
         sandesha2_fault_data_set_reason(fault_data, env, "");
-        return sandesha2_fault_mgr_get_fault(env, rm_msg_ctx, fault_data,
-            sandesha2_msg_ctx_get_addr_ns_val(rm_msg_ctx, env), seq_prop_mgr);
+
+        return sandesha2_fault_mgr_get_fault(env, rm_create_seq_msg_ctx, fault_data,
+            sandesha2_msg_ctx_get_addr_ns_val(rm_create_seq_msg_ctx, env), seq_prop_mgr);
     }
+
     return NULL;
 }
             

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_creator.c Tue Aug  5 09:39:52 2008
@@ -377,8 +377,15 @@
             accept = sandesha2_accept_create(env, rm_ns_value, addressing_ns_value);
             if(accept)
             {
+                axis2_endpoint_ref_t *temp_to_epr = NULL;
+
                 acks_to_epr = sandesha2_msg_ctx_get_to(create_seq_msg, env);
-                address = sandesha2_address_create(env, addressing_ns_value, acks_to_epr);
+                if(acks_to_epr)
+                {
+                    temp_to_epr = sandesha2_util_endpoint_ref_clone(env, acks_to_epr);
+                }
+
+                address = sandesha2_address_create(env, addressing_ns_value, temp_to_epr);
                 acks_to = sandesha2_acks_to_create(env, address, rm_ns_value, addressing_ns_value);
                 sandesha2_accept_set_acks_to(accept, env, acks_to);
                 sandesha2_create_seq_res_set_accept(create_seq_res, env, accept);
@@ -407,7 +414,11 @@
     axis2_msg_ctx_set_wsa_action(out_msg, env, temp_action);
 
     soap_action = axutil_string_create(env, temp_action);
-    axis2_msg_ctx_set_soap_action(out_msg, env, soap_action);
+    if(soap_action)
+    {
+        axis2_msg_ctx_set_soap_action(out_msg, env, soap_action);
+        axutil_string_free(soap_action, env);
+    }
 
     if(addressing_ns_value)
     {
@@ -415,10 +426,15 @@
     }
 
     new_msg_id = axutil_uuid_gen(env);
-    axis2_msg_ctx_set_message_id(out_msg, env, new_msg_id);
+    if(new_msg_id)
+    {
+        axis2_msg_ctx_set_message_id(out_msg, env, new_msg_id);
+        AXIS2_FREE(env->allocator, new_msg_id);
+    }
+
     axis2_msg_ctx_set_soap_envelope(out_msg, env, envelope);
     temp_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(create_seq_msg, env);
-    sandesha2_msg_creator_init_creation(env, temp_msg_ctx,out_msg);
+    sandesha2_msg_creator_init_creation(env, temp_msg_ctx, out_msg);
     create_seq_res_rm_msg_ctx = sandesha2_msg_init_init_msg(env, out_msg);
     sandesha2_msg_ctx_set_create_seq_res(create_seq_res_rm_msg_ctx, env, create_seq_res);
     temp_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(create_seq_msg, env);

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_init.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_init.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_init.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/msg_init.c Tue Aug  5 09:39:52 2008
@@ -130,18 +130,23 @@
     /* If client side and the addressing version is not set. 
      * Assuming the default addressing version.
      */
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
-        "[sandesha2]Entry:populate_rm_msg_ctx");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]Entry:populate_rm_msg_ctx");
     if(msg_ctx)
+    {
         ctx = axis2_msg_ctx_get_base(msg_ctx, env);
+    }
+
     prop = axis2_ctx_get_property(ctx, env, AXIS2_WSA_VERSION);
     if(prop)
+    {
         addressing_ns = axutil_property_get_value(prop, env);
+    }
     
     if(!addressing_ns && !axis2_msg_ctx_get_server_side(msg_ctx, env))
     {
         addressing_ns = AXIS2_WSA_NAMESPACE;
     }
+
     rm_elements = sandesha2_rm_elements_create(env);
     envelope = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
     action = (axis2_char_t*)axis2_msg_ctx_get_wsa_action(msg_ctx, env);
@@ -150,18 +155,17 @@
     if(create_seq)
     {
         sandesha2_msg_ctx_set_create_seq(rm_msg_ctx, env, create_seq);
-        rm_ns = sandesha2_create_seq_get_namespace_value(
-                 create_seq, env);
+        rm_ns = sandesha2_create_seq_get_namespace_value(create_seq, env);
     }
+
     create_seq_res = sandesha2_rm_elements_get_create_seq_res(rm_elements, env);
     if(create_seq_res)
     {
-        sandesha2_msg_ctx_set_create_seq_res(rm_msg_ctx, env, 
-            create_seq_res);
-        rm_ns = sandesha2_create_seq_res_get_namespace_value(
-                 create_seq_res, env);
+        sandesha2_msg_ctx_set_create_seq_res(rm_msg_ctx, env, create_seq_res);
+        rm_ns = sandesha2_create_seq_res_get_namespace_value(create_seq_res, env);
         /*add_op_if_null(env, msg_ctx);*/
     }
+
     seq = sandesha2_rm_elements_get_seq(rm_elements, env);
     if(seq)
     {

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/sandesha2_utils.c Tue Aug  5 09:39:52 2008
@@ -68,8 +68,10 @@
     axis2_msg_ctx_t *in_msg_ctx);
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
-sandesha2_utils_remove_soap_body_part(const axutil_env_t *env, 
-                        axiom_soap_envelope_t *envelope, axutil_qname_t *qname)
+sandesha2_utils_remove_soap_body_part(
+    const axutil_env_t *env, 
+    axiom_soap_envelope_t *envelope, 
+    axutil_qname_t *qname)
 {
     axiom_soap_body_t *soap_body = NULL;
     axiom_node_t *body_node = NULL;
@@ -84,29 +86,39 @@
     if(!soap_body)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "[sandesha2]Soap envelope does not have a soap body");
+                "[sandesha2] Soap envelope does not have a soap body");
         return AXIS2_FAILURE;
     }
+
     body_node = axiom_soap_body_get_base_node(soap_body, env);
     if(!body_node)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "[sandesha2]Soap body does not have a base node");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Soap body does not have a base node");
         return AXIS2_FAILURE;
     }
+
     body_element = axiom_node_get_data_element(body_node, env);
     if(!body_element)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-            "[sandesha2]Soap body node does not have a node element");
+                "[sandesha2] Soap body node does not have a node element");
         return AXIS2_FAILURE;
     }
-    body_rm_element = axiom_element_get_first_child_with_qname(body_element,
-                            env, qname, body_node, &body_rm_node);
+
+    body_rm_element = axiom_element_get_first_child_with_qname(body_element, env, qname, body_node, 
+            &body_rm_node);
+
     if(body_rm_element)
     {
-        axiom_node_detach(body_rm_node, env);
+        axiom_node_t *temp_node = NULL;
+
+        temp_node = axiom_node_detach(body_rm_node, env);
+        if(temp_node)
+        {
+            axiom_node_free_tree(temp_node, env);
+        }
     }
+
     return AXIS2_SUCCESS;
 }
 
@@ -1280,15 +1292,14 @@
     }
 
     reply_to = axis2_msg_info_headers_get_reply_to(old_msg_info_headers, env);
-    axis2_msg_info_headers_set_to(msg_info_headers, env, sandesha2_util_endpoint_ref_clone(env, 
-                reply_to));
+    axis2_msg_info_headers_set_to(msg_info_headers, env, reply_to);
 
     fault_to = axis2_msg_info_headers_get_fault_to(old_msg_info_headers, env);
     axis2_msg_info_headers_set_fault_to(msg_info_headers, env, sandesha2_util_endpoint_ref_clone(
                 env, fault_to));
 
     to = axis2_msg_info_headers_get_to(old_msg_info_headers, env);
-    axis2_msg_info_headers_set_from(msg_info_headers, env, sandesha2_util_endpoint_ref_clone(env, to));
+    axis2_msg_info_headers_set_from(msg_info_headers, env, to);
 
     msg_id = axis2_msg_info_headers_get_message_id(old_msg_info_headers, env);
     relates_to = axis2_relates_to_create(env, msg_id,

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/seq_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/seq_mgr.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/seq_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/seq_mgr.c Tue Aug  5 09:39:52 2008
@@ -76,7 +76,6 @@
     axis2_char_t *spec_version = NULL;
     axis2_char_t *address = NULL;
     axis2_char_t *reply_to_addr = NULL;
-    axis2_char_t *internal_sequence_id = NULL;
 
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "[sandesha2]Entry:sandesha2_seq_mgr_setup_new_rmd_sequence");
 
@@ -173,8 +172,15 @@
                                                     /* 1 will be the next */
     if(next_msg_bean)
     {
+        axis2_char_t *internal_sequence_id = NULL;
+
         internal_sequence_id = sandesha2_utils_get_internal_sequence_id(env, rmd_sequence_id);
-        sandesha2_next_msg_bean_set_internal_seq_id(next_msg_bean, env, internal_sequence_id);
+        if(internal_sequence_id)
+        {
+            sandesha2_next_msg_bean_set_internal_seq_id(next_msg_bean, env, internal_sequence_id);
+            AXIS2_FREE(env->allocator, internal_sequence_id);
+        }
+
         sandesha2_next_msg_mgr_insert(next_msg_mgr, env, next_msg_bean);
         sandesha2_next_msg_bean_free(next_msg_bean, env);
     }

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/util/terminate_mgr.c Tue Aug  5 09:39:52 2008
@@ -896,6 +896,8 @@
     {
         return AXIS2_FAILURE;
     }
+    
+    terminate_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(terminate_rm_msg_ctx, env);
 
     sandesha2_msg_ctx_set_flow(terminate_rm_msg_ctx, env, AXIS2_OUT_FLOW);
     property = axutil_property_create_with_args(env, 0, 0, 0, AXIS2_VALUE_TRUE);
@@ -926,6 +928,13 @@
             sandesha2_msg_ctx_free(terminate_rm_msg_ctx, env);
         }
 
+        if(terminate_msg_ctx)
+        {
+            /* Reset the message context to avoid double freeing of transport out stream */
+            axis2_core_utils_reset_out_msg_ctx(env, terminate_msg_ctx);
+            axis2_msg_ctx_free(terminate_msg_ctx, env);
+        }
+
         return AXIS2_FAILURE;
     }
 
@@ -952,8 +961,6 @@
     
     sandesha2_msg_ctx_add_soap_envelope(terminate_rm_msg_ctx, env);
     
-    terminate_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(terminate_rm_msg_ctx, env);
-
     /* If server side and single channel duplex mode send the terminate sequence message.
      */
     if(sandesha2_utils_is_rm_1_0_anonymous_acks_to(env, rm_ver, to_addr))
@@ -1193,7 +1200,7 @@
         sandesha2_msg_ctx_free(terminate_rm_msg_ctx, env);
     }
 
-    /* We have created this message context using sandesha2_utils_create_new_related_msg_ctx(). It is out
+    /* We have created this message context using sandesha2_utils_create_new_related_msg_ctx(). It is our
      * reponsiblity to free if after use.
      */
     if(terminate_msg_ctx)

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/accept.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/accept.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/accept.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/accept.c Tue Aug  5 09:39:52 2008
@@ -63,7 +63,6 @@
     
     accept->rm_ns_val = (axis2_char_t *)axutil_strdup(env ,rm_ns_val);
     accept->addr_ns_val = (axis2_char_t *)axutil_strdup(env, addr_ns_val);
-    accept->acks_to = NULL;
     
 	return accept;
 }
@@ -144,16 +143,24 @@
             AXIS2_FAILURE);
         return NULL;
     }
-    accept->acks_to = sandesha2_acks_to_create(env, NULL, 
-        accept->rm_ns_val, accept->addr_ns_val);
-    if(NULL == accept->acks_to)
+    
+    if(accept->acks_to)
+    {
+        sandesha2_acks_to_free(accept->acks_to, env);
+        accept->acks_to = NULL;
+    }
+
+    accept->acks_to = sandesha2_acks_to_create(env, NULL, accept->rm_ns_val, accept->addr_ns_val);
+    if(!accept->acks_to)
     {
         return NULL;
     }
+
     if(!sandesha2_acks_to_from_om_node(accept->acks_to, env, child_om_node))
     {
         return NULL;
     }
+
     return accept;
 }
 

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/ack_requested.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/ack_requested.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/ack_requested.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/ack_requested.c Tue Aug  5 09:39:52 2008
@@ -234,10 +234,10 @@
 {
  	if(ack_requested->identifier)
 	{
-		/*
-		SANDESHA2_IDENTIFIER_FREE(ack_requested->identifier, env);
+		
+		sandesha2_identifier_free(ack_requested->identifier, env);
 		ack_requested->identifier = NULL;
-		*/
+		
 	}
 	ack_requested->identifier = identifier;
  	return AXIS2_SUCCESS;

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/acks_to.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/acks_to.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/acks_to.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/acks_to.c Tue Aug  5 09:39:52 2008
@@ -138,8 +138,14 @@
             AXIS2_FAILURE);
         return NULL;
     }
-    acks_to->address = sandesha2_address_create(env, 
-        acks_to->addr_ns_val, NULL);
+
+    if(acks_to->address)
+    {
+        sandesha2_address_free(acks_to->address, env);
+        acks_to->address = NULL;
+    }
+
+    acks_to->address = sandesha2_address_create(env, acks_to->addr_ns_val, NULL);
     if(NULL == acks_to->address)
     {
         return NULL;

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/address.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/address.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/address.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/address.c Tue Aug  5 09:39:52 2008
@@ -129,7 +129,15 @@
             AXIS2_FAILURE);
         return NULL;
     }
+
+    if(address->epr)
+    {
+        axis2_endpoint_ref_free(address->epr, env);
+        address->epr = NULL;
+    }
+
     address->epr = axis2_endpoint_ref_create(env, str_address);
+
     if(!address->epr)
     {
         return NULL;

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq.c Tue Aug  5 09:39:52 2008
@@ -180,10 +180,10 @@
 {
  	if(close_seq->identifier)
 	{
-	    /*
-		SANDESHA2_IDENTIFIER_FREE(close_seq->identifier, env);
+	    
+		sandesha2_identifier_free(close_seq->identifier, env);
 		close_seq->identifier = NULL;
-		*/
+	
 	}
 	close_seq->identifier = identifier;
  	return AXIS2_SUCCESS;

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq_res.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq_res.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq_res.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/close_seq_res.c Tue Aug  5 09:39:52 2008
@@ -184,10 +184,8 @@
 {
  	if(close_seq_res->identifier)
 	{
-	    /*
-		SANDESHA2_IDENTIFIER_FREE(close_seq_res->identifier, env);
+		sandesha2_identifier_free(close_seq_res->identifier, env);
 		close_seq_res->identifier = NULL;
-		*/
 	}
 	close_seq_res->identifier = identifier;
  	return AXIS2_SUCCESS;

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/create_seq_res.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/create_seq_res.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/create_seq_res.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/create_seq_res.c Tue Aug  5 09:39:52 2008
@@ -46,21 +46,21 @@
     AXIS2_PARAM_CHECK(env->error, rm_ns_val, NULL);
     AXIS2_PARAM_CHECK(env->error, addr_ns_val, NULL);
     
-    if(AXIS2_FALSE == sandesha2_create_seq_res_is_namespace_supported(env, rm_ns_val))
+    if(!sandesha2_create_seq_res_is_namespace_supported(env, rm_ns_val))
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS, 
-            AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_UNSUPPORTED_NS, AXIS2_FAILURE);
         return NULL;
-    }    
-    create_seq_res =  (sandesha2_create_seq_res_t *)AXIS2_MALLOC 
-        (env->allocator, 
-        sizeof(sandesha2_create_seq_res_t));
+    }
+
+    create_seq_res =  (sandesha2_create_seq_res_t *) AXIS2_MALLOC(env->allocator, 
+            sizeof(sandesha2_create_seq_res_t));
 	
     if(!create_seq_res)
 	{
 		AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
 	}
+
     create_seq_res->rm_ns_val = NULL;
     create_seq_res->addr_ns_val = NULL;
     create_seq_res->identifier = NULL;
@@ -119,6 +119,7 @@
     }
 
 	AXIS2_FREE(env->allocator, create_seq_res);
+
 	return AXIS2_SUCCESS;
 }
 
@@ -198,8 +199,15 @@
         axutil_qname_free(acc_qname, env);
     if(acc_part)
     {
-        create_seq_res->accept = sandesha2_accept_create(env, 
-            create_seq_res->rm_ns_val, create_seq_res->addr_ns_val);
+        if(create_seq_res->accept)
+        {
+            sandesha2_accept_free(create_seq_res->accept, env);
+            create_seq_res->accept = NULL;
+        }
+
+        create_seq_res->accept = sandesha2_accept_create(env, create_seq_res->rm_ns_val, 
+                create_seq_res->addr_ns_val);
+
         if(!create_seq_res->accept)
         {
             return NULL;

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/identifier.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/identifier.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/identifier.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/identifier.c Tue Aug  5 09:39:52 2008
@@ -83,12 +83,15 @@
         AXIS2_FREE(env->allocator, identifier->ns_val);
         identifier->ns_val = NULL;
     }
+
     if(identifier->str_id)
     {
     	AXIS2_FREE(env->allocator, identifier->str_id);
         identifier->str_id = NULL;
     }
+
 	AXIS2_FREE(env->allocator, identifier);
+
 	return AXIS2_SUCCESS;
 }
 
@@ -116,47 +119,60 @@
     AXIS2_PARAM_CHECK(env->error, om_node, NULL);
     
     om_element = axiom_node_get_data_element(om_node, env);
-    if(NULL == om_element)
+    if(!om_element)
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
         return NULL;
     }
-    ident_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_IDENTIFIER, 
-                        identifier->ns_val, NULL); 
-    if(NULL == ident_qname)
+
+    ident_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_IDENTIFIER, identifier->ns_val, 
+            NULL); 
+
+    if(!ident_qname)
     {
         return NULL;
     }
-    ident_part = axiom_element_get_first_child_with_qname(om_element, env,
-                        ident_qname, om_node, &ident_node);
+
+    ident_part = axiom_element_get_first_child_with_qname(om_element, env, ident_qname, om_node, 
+            &ident_node);
+
     if(ident_qname)
+    {
         axutil_qname_free(ident_qname, env);
-    if(NULL == ident_part)
+    }
+
+    if(!ident_part)
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_NULL_OM_ELEMENT, AXIS2_FAILURE);
         return NULL;
     }
+
     ident_str = axiom_element_get_text(ident_part, env, ident_node);
-    if(NULL == ident_str)
+    if(!ident_str)
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_EMPTY_OM_ELEMENT,
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_EMPTY_OM_ELEMENT, AXIS2_FAILURE);
         return NULL;
     }
+
+    if(identifier->str_id)
+    {
+        AXIS2_FREE(env->allocator, identifier->str_id);
+    }
+
     identifier->str_id = axutil_strdup(env, ident_str);
-    if(NULL == identifier->str_id)
+    if(!identifier->str_id)
     {
         return NULL;
     }
+
     return identifier;
 }
 
 axiom_node_t* AXIS2_CALL 
 sandesha2_identifier_to_om_node(
     sandesha2_identifier_t *identifier,
-    const axutil_env_t *env, void *om_node)
+    const axutil_env_t *env, 
+    void *om_node)
 {
     axiom_namespace_t *rm_ns = NULL;
     axiom_element_t *id_element = NULL;
@@ -164,28 +180,27 @@
     
     AXIS2_PARAM_CHECK(env->error, om_node, NULL);
     
-    if(!identifier->str_id || 0 == axutil_strlen(
-                        identifier->str_id))
+    if(!identifier->str_id || 0 == axutil_strlen(identifier->str_id))
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT, 
-                        AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT, AXIS2_FAILURE);
         return NULL;
     }
-    rm_ns = axiom_namespace_create(env, identifier->ns_val,
-                        SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
+
+    rm_ns = axiom_namespace_create(env, identifier->ns_val, SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
     if(!rm_ns)
     {
         return NULL;
     }
-    id_element = axiom_element_create(env, NULL, 
-                        SANDESHA2_WSRM_COMMON_IDENTIFIER, rm_ns, &id_node);
+
+    id_element = axiom_element_create(env, (axiom_node_t *) om_node, 
+            SANDESHA2_WSRM_COMMON_IDENTIFIER, rm_ns, &id_node);
     if(!id_element)
     {
         return NULL;
     }
-    axiom_element_set_text(id_element, env, identifier->str_id, 
-                        id_node);
-    axiom_node_add_child((axiom_node_t*)om_node, env, id_node);
+
+    axiom_element_set_text(id_element, env, identifier->str_id, id_node);
+
     return (axiom_node_t*)om_node;
 }
 

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/rm_elements.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/rm_elements.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/rm_elements.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/rm_elements.c Tue Aug  5 09:39:52 2008
@@ -179,48 +179,53 @@
             rm_elements->create_seq, env, create_seq_node);
     }
     
-    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CREATE_SEQ_RESPONSE, 
-                        rm_ns_val, NULL);
-    create_seq_res_element = axiom_element_get_first_child_with_qname(
-        body_element, env, qname, body_node, &create_seq_res_node);
+    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CREATE_SEQ_RESPONSE, rm_ns_val, NULL);
+    create_seq_res_element = axiom_element_get_first_child_with_qname(body_element, env, qname, 
+            body_node, &create_seq_res_node);
+
     if(qname)
+    {
         axutil_qname_free(qname, env);
+    }
+
     if(create_seq_res_node)
     {
-        rm_elements->create_seq_res = sandesha2_create_seq_res_create(env, 
-                        rm_ns_val, addr_ns_val);
-        sandesha2_create_seq_res_from_om_node(
-            rm_elements->create_seq_res, env, create_seq_res_node);
+        rm_elements->create_seq_res = sandesha2_create_seq_res_create(env, rm_ns_val, addr_ns_val);
+        sandesha2_create_seq_res_from_om_node(rm_elements->create_seq_res, env, create_seq_res_node);
     }
     
-    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_TERMINATE_SEQ, 
-                        rm_ns_val, NULL);
-    terminate_seq_element = axiom_element_get_first_child_with_qname(
-        body_element, env, qname, body_node, &terminate_seq_node);
+    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_TERMINATE_SEQ, rm_ns_val, NULL);
+    terminate_seq_element = axiom_element_get_first_child_with_qname(body_element, env, qname, 
+            body_node, &terminate_seq_node);
+
     if(qname)
+    {
         axutil_qname_free(qname, env);
+    }
+
     if(terminate_seq_node)
     {
-        rm_elements->terminate_seq = sandesha2_terminate_seq_create(env, 
-            rm_ns_val);
-        sandesha2_terminate_seq_from_om_node(
-            rm_elements->terminate_seq, env, terminate_seq_node);
+        rm_elements->terminate_seq = sandesha2_terminate_seq_create(env, rm_ns_val);
+        sandesha2_terminate_seq_from_om_node(rm_elements->terminate_seq, env, terminate_seq_node);
     }
-    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_TERMINATE_SEQ_RESPONSE, 
-        rm_ns_val, NULL);
-    terminate_seq_res_element = axiom_element_get_first_child_with_qname(
-        body_element, env, qname, body_node, &terminate_seq_res_node);
+
+    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_TERMINATE_SEQ_RESPONSE, rm_ns_val, NULL);
+    terminate_seq_res_element = axiom_element_get_first_child_with_qname(body_element, env, qname, 
+            body_node, &terminate_seq_res_node);
+
     if(qname)
+    {
         axutil_qname_free(qname, env);
+    }
+
     if(terminate_seq_res_node)
     {
-        rm_elements->terminate_seq_res = sandesha2_terminate_seq_res_create(
-            env, rm_ns_val);
-        sandesha2_terminate_seq_res_from_om_node(
-            rm_elements->terminate_seq_res, env, terminate_seq_res_node);
+        rm_elements->terminate_seq_res = sandesha2_terminate_seq_res_create(env, rm_ns_val);
+        sandesha2_terminate_seq_res_from_om_node(rm_elements->terminate_seq_res, env, 
+                terminate_seq_res_node);
     }
-    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ, rm_ns_val, 
-        NULL);
+
+    qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_CLOSE_SEQ, rm_ns_val, NULL);
     close_seq_element = axiom_element_get_first_child_with_qname(body_element, 
         env, qname, body_node, &close_seq_node);
     if(qname)

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq.c Tue Aug  5 09:39:52 2008
@@ -118,6 +118,7 @@
             AXIS2_FAILURE);
         return NULL;
     }
+
     terminate_seq->identifier = sandesha2_identifier_create(env, 
         terminate_seq->ns_val);
     if(!terminate_seq->identifier)
@@ -144,25 +145,25 @@
     
     if(!terminate_seq->identifier)
     {
-        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT, 
-            AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, SANDESHA2_ERROR_TO_OM_NULL_ELEMENT, AXIS2_FAILURE);
         return NULL;
     }
-    rm_ns = axiom_namespace_create(env, terminate_seq->ns_val,
-        SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
+
+    rm_ns = axiom_namespace_create(env, terminate_seq->ns_val, SANDESHA2_WSRM_COMMON_NS_PREFIX_RM);
     if(!rm_ns)
     {
         return NULL;
     }
-    ts_element = axiom_element_create(env, NULL, 
-        SANDESHA2_WSRM_COMMON_TERMINATE_SEQ, rm_ns, &ts_node);
+
+    ts_element = axiom_element_create(env, (axiom_node_t *) om_node, 
+            SANDESHA2_WSRM_COMMON_TERMINATE_SEQ, rm_ns, &ts_node);
+
     if(!ts_element)
     {
         return NULL;
     }
-    sandesha2_identifier_to_om_node(terminate_seq->identifier, env, 
-        ts_node);
-    axiom_node_add_child((axiom_node_t*)om_node, env, ts_node);
+
+    sandesha2_identifier_to_om_node(terminate_seq->identifier, env, ts_node);
     return (axiom_node_t*)om_node;
 }
 
@@ -182,9 +183,10 @@
 {
  	if(terminate_seq->identifier)
 	{
-/*		SANDESHA2_IDENTIFIER_FREE(terminate_seq->identifier, env); 
-		terminate_seq->identifier = NULL;  */
+		sandesha2_identifier_free(terminate_seq->identifier, env); 
+		terminate_seq->identifier = NULL; 
 	}
+
 	terminate_seq->identifier = identifier;
  	return AXIS2_SUCCESS;
 }
@@ -201,18 +203,22 @@
 	/**
      * Remove if old exists
      */
-    ts_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_TERMINATE_SEQ, 
-        terminate_seq->ns_val, NULL);
+    ts_qname = axutil_qname_create(env, SANDESHA2_WSRM_COMMON_TERMINATE_SEQ, terminate_seq->ns_val, 
+            NULL);
+
     if(!ts_qname)
     {
         return AXIS2_FAILURE;
     }
+
     sandesha2_utils_remove_soap_body_part(env, envelope, ts_qname);
-    body_node = axiom_soap_body_get_base_node(axiom_soap_envelope_get_body(
-        envelope, env), env);  
+    body_node = axiom_soap_body_get_base_node(axiom_soap_envelope_get_body(envelope, env), env);  
     sandesha2_terminate_seq_to_om_node(terminate_seq, env, body_node);
     if(ts_qname)
+    {
         axutil_qname_free(ts_qname, env);
+    }
+
 	return AXIS2_SUCCESS;
 }
 

Modified: webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq_res.c
URL: http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq_res.c?rev=682784&r1=682783&r2=682784&view=diff
==============================================================================
--- webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq_res.c (original)
+++ webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/src/wsrm/terminate_seq_res.c Tue Aug  5 09:39:52 2008
@@ -178,10 +178,10 @@
 {
  	if(terminate_seq_res->identifier)
 	{
-/*		SANDESHA2_IDENTIFIER_FREE(terminate_seq_res->identifier, env);
+		sandesha2_identifier_free(terminate_seq_res->identifier, env);
 		terminate_seq_res->identifier = NULL;
-*/		
 	}
+
 	terminate_seq_res->identifier = identifier;
  	return AXIS2_SUCCESS;
 }



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


Mime
View raw message