Author: damitha
Date: Sat May 31 21:13:44 2008
New Revision: 662145

URL: http://svn.apache.org/viewvc?rev=662145&view=rev
Log:
Fixing memory leaks

Modified:
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/include/sandesha2_msg_creator.h
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/app_msg_processor.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/create_seq_res_msg_processor.c
    
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/util/msg_creator.c

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/include/sandesha2_msg_creator.h
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/include/sandesha2_msg_creator.h?rev=662145&r1=662144&r2=662145&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/include/sandesha2_msg_creator.h
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/include/sandesha2_msg_creator.h
 Sat May 31 21:13:44 2008
@@ -57,6 +57,8 @@
     sandesha2_msg_ctx_t *application_rm_msg, 
     axis2_char_t *internal_seq_id,
     axis2_char_t *acks_to,
+    axis2_char_t *spec_version,
+    axis2_char_t *addr_ns_value,
     sandesha2_seq_property_mgr_t *seq_prop_mgr);
 
 /**

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/app_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/app_msg_processor.c?rev=662145&r1=662144&r2=662145&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/app_msg_processor.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/app_msg_processor.c
 Sat May 31 21:13:44 2008
@@ -57,6 +57,7 @@
 #include <axiom_soap_const.h>
 #include <axiom_soap_body.h>
 #include <axis2_http_transport_utils.h>
+#include <axis2_addr.h>
 
 /** 
  * @brief Application Message Processor struct impl
@@ -114,6 +115,8 @@
     sandesha2_msg_ctx_t *msg_ctx,
     axis2_char_t *internal_seq_id,
     axis2_char_t *acks_to,
+    axis2_char_t *spec_version,
+    axis2_char_t *addr_ns_value,
     sandesha2_storage_mgr_t *storage_mgr,
     sandesha2_seq_property_mgr_t *seq_prop_mgr,
     sandesha2_create_seq_mgr_t *create_seq_mgr,
@@ -1415,15 +1418,39 @@
 
                 sandesha2_seq_property_mgr_insert(seq_prop_mgr, env, 
create_seq_added);
 
-                addr_ns_uri = sandesha2_utils_get_seq_property(env, 
rms_internal_sequence_id, 
-                        SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, 
seq_prop_mgr);
+                /*addr_ns_uri = sandesha2_utils_get_seq_property(env, 
rms_internal_sequence_id, 
+                        SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, 
seq_prop_mgr);*/
+                property = axis2_msg_ctx_get_property(msg_ctx, env, 
AXIS2_WSA_VERSION);
+                if(property)
+                {
+                    addr_ns_uri = axutil_property_get_value(property, env);
+                }
 
-                anon_uri = sandesha2_spec_specific_consts_get_anon_uri(env, 
addr_ns_uri);
-                if(addr_ns_uri)
+                if(!addr_ns_uri)
                 {
-                    AXIS2_FREE(env->allocator, addr_ns_uri);
+                    axis2_op_ctx_t *op_ctx = NULL;
+                    axis2_msg_ctx_t *req_msg_ctx = NULL;
+
+                    op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
+                    req_msg_ctx =  axis2_op_ctx_get_msg_ctx(op_ctx, env, 
AXIS2_WSDL_MESSAGE_LABEL_IN);
+
+                    if(req_msg_ctx)
+                    {
+                        property = axis2_msg_ctx_get_property(req_msg_ctx, 
env, AXIS2_WSA_VERSION);
+                        if(property)
+                        {
+                            addr_ns_uri = axutil_property_get_value(property, 
env);
+                        }
+                    }
+                }
+
+                if(!addr_ns_uri)
+                {
+                    addr_ns_uri = AXIS2_WSA_NAMESPACE;
                 }
 
+                anon_uri = sandesha2_spec_specific_consts_get_anon_uri(env, 
addr_ns_uri);
+
                 if(axis2_msg_ctx_get_svc_ctx(msg_ctx, env))
                 {
                     property = axis2_msg_ctx_get_property(msg_ctx, env, 
SANDESHA2_CLIENT_ACKS_TO);
@@ -1471,7 +1498,7 @@
                  */
                 AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "acks_to:%s", acks_to);
                 sandesha2_app_msg_processor_send_create_seq_msg(env, 
rm_msg_ctx, rms_internal_sequence_id, 
-                        acks_to, storage_mgr, seq_prop_mgr, create_seq_mgr, 
sender_mgr);
+                        acks_to, spec_ver, addr_ns_uri, storage_mgr, 
seq_prop_mgr, create_seq_mgr, sender_mgr);
             }
         }
     }
@@ -1785,14 +1812,16 @@
                        
 static axis2_status_t AXIS2_CALL
 sandesha2_app_msg_processor_send_create_seq_msg(
-     const axutil_env_t *env,
-     sandesha2_msg_ctx_t *rm_msg_ctx,
-     axis2_char_t *rms_internal_sequence_id,
-     axis2_char_t *acks_to,
-     sandesha2_storage_mgr_t *storage_mgr,
-     sandesha2_seq_property_mgr_t *seq_prop_mgr,
-     sandesha2_create_seq_mgr_t *create_seq_mgr,
-     sandesha2_sender_mgr_t *sender_mgr)
+    const axutil_env_t *env,
+    sandesha2_msg_ctx_t *rm_msg_ctx,
+    axis2_char_t *rms_internal_sequence_id,
+    axis2_char_t *acks_to,
+    axis2_char_t *spec_version,
+    axis2_char_t *addr_ns_value,
+    sandesha2_storage_mgr_t *storage_mgr,
+    sandesha2_seq_property_mgr_t *seq_prop_mgr,
+    sandesha2_create_seq_mgr_t *create_seq_mgr,
+    sandesha2_sender_mgr_t *sender_mgr)
 {
     axis2_msg_ctx_t *msg_ctx = NULL;
     sandesha2_create_seq_t *create_seq_part = NULL;
@@ -1820,10 +1849,15 @@
     AXIS2_PARAM_CHECK(env->error, create_seq_mgr, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, seq_prop_mgr, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, sender_mgr, AXIS2_FAILURE);
-    
+  
+    if(addr_ns_value)
+    {
+        addr_ns_uri = axutil_strdup(env, addr_ns_value);
+    }
+
     msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
     create_seq_rm_msg = sandesha2_msg_creator_create_create_seq_msg(env, 
rm_msg_ctx, rms_internal_sequence_id, 
-            acks_to, seq_prop_mgr);
+            acks_to, spec_version, addr_ns_value, seq_prop_mgr);
     if(!create_seq_rm_msg)
     {
         return AXIS2_FAILURE;
@@ -1877,8 +1911,11 @@
     sandesha2_create_seq_bean_set_ref_msg_store_key(create_seq_bean, env, 
create_sequence_msg_store_key);
     sandesha2_create_seq_mgr_insert(create_seq_mgr, env, create_seq_bean);
 
-    addr_ns_uri = sandesha2_utils_get_seq_property(env, 
rms_internal_sequence_id, 
-            SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr);
+    if(!addr_ns_uri)
+    {
+        addr_ns_uri = sandesha2_utils_get_seq_property(env, 
rms_internal_sequence_id, 
+                SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr);
+    }
 
     anon_uri = sandesha2_spec_specific_consts_get_anon_uri(env, addr_ns_uri);
     if(addr_ns_uri)

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/create_seq_res_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/create_seq_res_msg_processor.c?rev=662145&r1=662144&r2=662145&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/create_seq_res_msg_processor.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/msgprocessors/create_seq_res_msg_processor.c
 Sat May 31 21:13:44 2008
@@ -384,7 +384,7 @@
         
         acks_to = (axis2_char_t *) axis2_endpoint_ref_get_address(acks_to_epr, 
env);
         create_seq_rm_msg = sandesha2_msg_creator_create_create_seq_msg(env, 
rm_msg_ctx, 
-                rms_internal_sequence_id, acks_to, seq_prop_mgr);
+                rms_internal_sequence_id, acks_to, NULL, NULL, seq_prop_mgr);
 
         if(!create_seq_rm_msg)
         {

Modified: 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/util/msg_creator.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/util/msg_creator.c?rev=662145&r1=662144&r2=662145&view=diff
==============================================================================
--- 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/util/msg_creator.c
 (original)
+++ 
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-30may2008/src/util/msg_creator.c
 Sat May 31 21:13:44 2008
@@ -80,6 +80,8 @@
     sandesha2_msg_ctx_t *application_rm_msg, 
     axis2_char_t *internal_seq_id,
     axis2_char_t *acks_to,
+    axis2_char_t *spec_version,
+    axis2_char_t *addr_ns_value,
     sandesha2_seq_property_mgr_t *seq_prop_mgr)
 {
     axis2_msg_ctx_t *application_msg_ctx = NULL;
@@ -109,6 +111,16 @@
     sandesha2_acks_to_t *temp_acks_to = NULL;
     axutil_property_t *property = NULL;
 
+    if(spec_version)
+    {
+        rm_version = axutil_strdup(env, spec_version);
+    }
+
+    if(addr_ns_value)
+    {
+        addressing_ns_value = axutil_strdup(env, addr_ns_value);
+    }
+
     application_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(application_rm_msg, 
env);
     if(!application_msg_ctx)
     {
@@ -199,7 +211,10 @@
     }
     create_seq_rm_msg = sandesha2_msg_ctx_create(env, create_seq_msg_ctx);
 
-    rm_version = sandesha2_utils_get_rm_version(env, internal_seq_id, 
seq_prop_mgr);
+    if(!rm_version)
+    {
+        rm_version = sandesha2_utils_get_rm_version(env, internal_seq_id, 
seq_prop_mgr);
+    }
 
     if(!rm_version)
     {
@@ -209,8 +224,11 @@
     }
 
     rm_ns_value = sandesha2_spec_specific_consts_get_rm_ns_val(env, 
rm_version);
-    addressing_ns_value = sandesha2_utils_get_seq_property(env, 
internal_seq_id, 
-        SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr);
+    if(!addressing_ns_value)
+    {
+        addressing_ns_value = sandesha2_utils_get_seq_property(env, 
internal_seq_id, 
+            SANDESHA2_SEQ_PROP_ADDRESSING_NAMESPACE_VALUE, seq_prop_mgr);
+    }
 
     create_seq_part = sandesha2_create_seq_create(env, addressing_ns_value, 
rm_ns_value);
 



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

Reply via email to