Author: damitha
Date: Fri Apr 20 04:19:52 2007
New Revision: 530743

URL: http://svn.apache.org/viewvc?view=rev&rev=530743
Log:
Fixed the problem related to double freeing the AXIS2_TRANSPORT_IN property

Modified:
    webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
    webservices/sandesha/trunk/c/src/util/msg_creator.c
    webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
    webservices/sandesha/trunk/c/src/workers/sender_worker.c

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c?view=diff&rev=530743&r1=530742&r2=530743
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/create_seq_msg_processor.c 
Fri Apr 20 04:19:52 2007
@@ -194,7 +194,7 @@
     if(fault_rm_msg_ctx)
     {
         axis2_engine_t *engine = NULL;
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
             "[sandesha2]A fault occurred in 
create_seq_msg_processor_process_in_msg"); 
         engine = axis2_engine_create(env, conf_ctx);
         axis2_engine_send_fault(engine, env, sandesha2_msg_ctx_get_msg_ctx(

Modified: webservices/sandesha/trunk/c/src/util/msg_creator.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/msg_creator.c?view=diff&rev=530743&r1=530742&r2=530743
==============================================================================
--- webservices/sandesha/trunk/c/src/util/msg_creator.c (original)
+++ webservices/sandesha/trunk/c/src/util/msg_creator.c Fri Apr 20 04:19:52 2007
@@ -604,19 +604,6 @@
     }
     temp_msg_id = axutil_uuid_gen(env);
     axis2_msg_ctx_set_message_id(terminate_seq_msg_ctx, env, temp_msg_id);
-    /*ref_msg_op = axis2_msg_ctx_get_op(ref_msg_ctx, env);
-    if(ref_msg_op)
-    {
-        axutil_array_list_t *outphases = NULL;
-        axutil_array_list_t *out_fault_phases = NULL;
-
-        outphases = axis2_op_get_out_flow(ref_msg_op, env);
-        out_fault_phases = axis2_op_get_fault_out_flow(ref_msg_op, env);
-        if(outphases)
-            axis2_op_set_out_flow(terminate_seq_op, env, outphases);
-        if(out_fault_phases)        
-            axis2_op_set_fault_out_flow(terminate_seq_op, env, 
out_fault_phases);
-    }*/
     temp_envelope = sandesha2_msg_ctx_get_soap_envelope(ref_rm_msg, env);
     soap_version = sandesha2_utils_get_soap_version(env, temp_envelope);
     envelope = axiom_soap_envelope_create_default_soap_envelope(env, 
soap_version);
@@ -632,7 +619,7 @@
     sandesha2_msg_creator_finalize_creation(env, ref_msg_ctx, 
                         terminate_seq_msg_ctx);
     axis2_msg_ctx_set_property(terminate_seq_msg_ctx, env, AXIS2_TRANSPORT_IN,
-                        NULL);
+        NULL);
     return terminate_rm_msg;
 }
 
@@ -737,7 +724,6 @@
                 temp_name = axutil_param_get_name(next_param, env);
                 temp_value = axutil_param_get_value(next_param, env);
                 new_param = axutil_param_create(env, temp_name, temp_value);
-                /*new_param->ops->value_free = next_param->ops->value_free;*/
                 axis2_op_add_param(new_op, env, new_param); 
             }
         }
@@ -774,55 +760,23 @@
                 if(prop)
                     new_prop = axutil_property_clone(prop, env);
                 if(new_prop)
+                {
+                    if(0 == axutil_strcmp(AXIS2_TRANSPORT_IN, key))
+                    {
+                        axutil_property_set_own_value(new_prop, env, 
AXIS2_FALSE);
+                    }
                     axis2_ctx_set_property(ctx, env, key, new_prop);
+                }
             }
         }
     }
-    /* Message Context properties */
-    /*if(related_msg && new_msg)
-    {
-        axutil_hash_t *old_msg_ctx_props = NULL;
-        axis2_ctx_t *ctx = NULL;
-        
-        ctx = axis2_msg_ctx_get_base(related_msg, env);
-        old_msg_ctx_props = axis2_ctx_get_all_properties(ctx, env);
-        if(old_msg_ctx_props)
-        {
-            axutil_hash_index_t *i = NULL;
-
-            for (i = axutil_hash_first (old_msg_ctx_props, env); i; i = 
-                    axutil_hash_next (env, i))
-            {
-                void *v = NULL;
-                void *k = NULL;
-                axis2_char_t *key = NULL;
-                axutil_property_t *prop = NULL;
-                axutil_property_t *new_prop = NULL;
-                axis2_ctx_t *ctx = NULL;
-
-                axutil_hash_this (i, (const void **)&k, NULL, &v);
-                key = (axis2_char_t *) k;
-                prop = (axutil_property_t *) v;
-                ctx = axis2_msg_ctx_get_base(new_msg, env);
-                if(prop)
-                    new_prop = axutil_property_clone(prop, env);
-                if(new_prop)
-                    axis2_ctx_set_property(ctx, env, key, new_prop, 
AXIS2_FALSE);
-            }
-        }
-    }*/
     /* Setting options with properties copied from the old one */
-
     if(related_msg && new_msg)
     {
         related_ctx = axis2_msg_ctx_get_base(related_msg, env);
         related_msg_props = axis2_ctx_get_all_properties(related_ctx, env);
         new_ctx = axis2_msg_ctx_get_base(new_msg, env);
         new_msg_props = axis2_ctx_get_all_properties(new_ctx, env);
-        /*if(!new_msg_props)
-        {
-            new_msg_props = axutil_hash_make(env);
-        }*/
         if(related_msg_props)
         {
             axutil_hash_index_t *i = NULL;
@@ -842,7 +796,13 @@
                 if(prop)
                     new_prop = axutil_property_clone(prop, env);
                 if(new_prop)
-                axutil_hash_set(new_msg_props, key, AXIS2_HASH_KEY_STRING, 
new_prop);
+                {
+                    if(0 == axutil_strcmp(AXIS2_TRANSPORT_IN, key))
+                    {
+                        axutil_property_set_own_value(new_prop, env, 
AXIS2_FALSE);
+                    }
+                    axutil_hash_set(new_msg_props, key, AXIS2_HASH_KEY_STRING, 
new_prop);
+                }
             }
         }
     }

Modified: webservices/sandesha/trunk/c/src/util/sandesha2_utils.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/sandesha2_utils.c?view=diff&rev=530743&r1=530742&r2=530743
==============================================================================
--- webservices/sandesha/trunk/c/src/util/sandesha2_utils.c (original)
+++ webservices/sandesha/trunk/c/src/util/sandesha2_utils.c Fri Apr 20 04:19:52 
2007
@@ -755,14 +755,6 @@
     property = axutil_property_create_with_args(env, 0, 0, 0, addr_ver);
     axis2_msg_ctx_set_property(new_msg, env, AXIS2_WSA_VERSION, property);
     
-    /*property = axis2_msg_ctx_get_property(ref_msg, env, AXIS2_TRANSPORT_OUT, 
-                        AXIS2_FALSE);
-    if(property)
-    {
-        axutil_property_set_scope(property, env, AXIS2_SCOPE_APPLICATION);
-        axis2_msg_ctx_set_property(new_msg, env, AXIS2_TRANSPORT_OUT, 
-            axutil_property_clone(property, env), AXIS2_FALSE);
-    }*/
     out_stream = axis2_msg_ctx_get_transport_out_stream(ref_msg, 
         env);
     axis2_msg_ctx_set_transport_out_stream(new_msg, env, out_stream);

Modified: webservices/sandesha/trunk/c/src/workers/sender_worker.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/workers/sender_worker.c?view=diff&rev=530743&r1=530742&r2=530743
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Fri Apr 20 
04:19:52 2007
@@ -354,9 +354,6 @@
     }
     rm_msg_ctx = sandesha2_msg_init_init_msg(env, msg_ctx);
     
-    /* Avoid retrieving property bean from operation until it is availbale */
-    /*prop_bean = sandesha2_utils_get_property_bean_from_op(env, 
-        axis2_msg_ctx_get_op(msg_ctx, env));*/
     prop_bean = sandesha2_utils_get_property_bean(env, 
         axis2_conf_ctx_get_conf(sender_worker->conf_ctx, env));
     if(prop_bean)
@@ -434,14 +431,12 @@
             axis2_msg_ctx_set_property(msg_ctx, env, 
                 SANDESHA2_WITHIN_TRANSACTION, property);
         }
+        /* This is neccessary to avoid a double free */
+        axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_TRANSPORT_IN, NULL);
         /* Consider building soap envelope */
         AXIS2_TRANSPORT_SENDER_INVOKE(transport_sender, env, msg_ctx);
         successfully_sent = AXIS2_TRUE;
         sender_worker->counter++;
-        /*printf("**********************counter******************:%d\n", 
sender_worker->counter);
-        if(2 == sender_worker->counter)
-        sleep(300000);*/
-                    
     }
     transaction = sandesha2_storage_mgr_get_transaction(storage_mgr, env);
     property = axis2_msg_ctx_get_property(msg_ctx, env, 
@@ -591,13 +586,13 @@
      * Message Receiver (may be callback MR).
      */
     axis2_msg_ctx_set_server_side(res_msg_ctx, env, AXIS2_TRUE);
-    /*property = axis2_msg_ctx_get_property(msg_ctx, env, AXIS2_TRANSPORT_IN);
+    property = axis2_msg_ctx_get_property(msg_ctx, env, AXIS2_TRANSPORT_IN);
     if(property)
     {
         axutil_property_t *temp_prop = axutil_property_clone(property, env);
         axis2_msg_ctx_set_property(res_msg_ctx, env, AXIS2_TRANSPORT_IN, 
             temp_prop);
-    }*/
+    }
     axis2_msg_ctx_set_svc_ctx(res_msg_ctx, env, axis2_msg_ctx_get_svc_ctx(
         msg_ctx, env));
     axis2_msg_ctx_set_svc_grp_ctx(res_msg_ctx, env, 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to