Author: damitha
Date: Thu May  8 13:13:43 2008
New Revision: 654609

URL: http://svn.apache.org/viewvc?rev=654609&view=rev
Log:
Fixing SANDESHA2C-50

Modified:
    webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h
    webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
    webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
    webservices/sandesha/trunk/c/src/util/terminate_mgr.c

Modified: webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h?rev=654609&r1=654608&r2=654609&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h 
(original)
+++ webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h Thu May  
8 13:13:43 2008
@@ -44,6 +44,12 @@
 sandesha2_app_msg_processor_create(
     const axutil_env_t *env);
                         
+long AXIS2_CALL                 
+sandesha2_app_msg_processor_get_prev_msg_no(
+    const axutil_env_t *env,
+    axis2_char_t *internal_seq_id,
+    struct sandesha2_seq_property_mgr *seq_prop_mgr);
+
 axis2_status_t AXIS2_CALL 
 sandesha2_app_msg_processor_send_ack_if_reqd(
     const axutil_env_t *env,

Modified: webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c?rev=654609&r1=654608&r2=654609&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/ack_msg_processor.c Thu May  
8 13:13:43 2008
@@ -423,10 +423,20 @@
         if(highest_out_msg_no > 0)
         {
             axis2_bool_t completed = AXIS2_FALSE;
+            axis2_endpoint_ref_t *to = NULL;
+            axis2_char_t *to_address = NULL;
+
             completed = sandesha2_ack_mgr_verify_seq_completion(env, 
                 ack_range_list, highest_out_msg_no);
-            if(completed)
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"came10***********************");
+            to = sandesha2_msg_ctx_get_to(rm_msg_ctx, env);
+            if(to)
+            {
+                to_address = axis2_endpoint_ref_get_address(to, env);
+            }
+            if(completed && sandesha2_utils_is_anon_uri(env, to_address))
             {
+                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"came11***********************");
                 AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
                         "[sandesha2]Sequence %s is completed. So adding 
terminate msg", 
                         out_seq_id); 

Modified: webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c?rev=654609&r1=654608&r2=654609&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c 
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Thu May  
8 13:13:43 2008
@@ -114,12 +114,6 @@
     sandesha2_seq_property_mgr_t *seq_prop_mgr,
     sandesha2_sender_mgr_t *sender_mgr);
 
-static long AXIS2_CALL                 
-sandesha2_app_msg_processor_get_prev_msg_no(
-    const axutil_env_t *env,
-    axis2_char_t *internal_seq_id,
-    sandesha2_seq_property_mgr_t *seq_prop_mgr);
-
 static axis2_status_t AXIS2_CALL                 
 sandesha2_app_msg_processor_set_next_msg_no(
     const axutil_env_t *env,
@@ -233,7 +227,7 @@
     axis2_op_t *op = NULL;
     int mep = -1;
     axis2_char_t *dbname = NULL;
-    axis2_char_t *last_out_msg_no_str = NULL;
+    /*axis2_char_t *last_out_msg_no_str = NULL;*/
    
     AXIS2_PARAM_CHECK(env->error, rm_msg_ctx, AXIS2_FAILURE);
     AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,  
@@ -620,61 +614,10 @@
         wsa_action) || 0 == axutil_strcmp(
         SANDESHA2_SPEC_2005_02_SOAP_ACTION_LAST_MESSAGE, soap_action)) 
     {
-        sandesha2_seq_ack_t *seq_ack = NULL;
-
         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
             "[sandesha2]Got WSRM 1.0 last message, aborting");
-        /*sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx, 
msgs_str, 
-            storage_mgr, sender_mgr, seq_prop_mgr);*/
-
-        seq_ack = sandesha2_msg_ctx_get_seq_ack(rm_msg_ctx, env);
-        if(seq_ack)
-        {
-            axis2_char_t *int_seq_id = NULL;
-            axis2_char_t *out_seq_id = NULL;
-            long highest_out_msg_no = 0;
-            
-            /* If there is a sequence acknowledgement element present in the 
sequence we will check
-             * whether the sequence is completed. If so send a terminate 
sequence message.
-             */
-            out_seq_id = sandesha2_identifier_get_identifier(
-                sandesha2_seq_ack_get_identifier(seq_ack, env), env);
-            int_seq_id = sandesha2_utils_get_seq_property(env, out_seq_id, 
-                    SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, seq_prop_mgr);
-            last_out_msg_no_str = sandesha2_utils_get_seq_property(env, 
int_seq_id,
-                SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NO, seq_prop_mgr);
-            if(last_out_msg_no_str)
-            {
-                highest_out_msg_no = atol(last_out_msg_no_str);
-                if(last_out_msg_no_str)
-                    AXIS2_FREE(env->allocator, last_out_msg_no_str);
-            }
-            else
-            {
-                highest_out_msg_no = 
sandesha2_app_msg_processor_get_prev_msg_no(env, 
-                    int_seq_id, seq_prop_mgr);
-            }
-            if(highest_out_msg_no > 0)
-            {
-                axis2_bool_t completed = AXIS2_FALSE;
-                axutil_array_list_t *ack_range_list = NULL;
-
-                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"highest_out_msg_no:%ld", highest_out_msg_no);
-
-                ack_range_list = sandesha2_seq_ack_get_ack_range_list(seq_ack, 
env);
-                completed = sandesha2_ack_mgr_verify_seq_completion(env, 
-                    ack_range_list, highest_out_msg_no);
-                if(completed)
-                {
-                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
-                            "[sandesha2]Sequence %s is completed. So adding 
terminate msg", 
-                            out_seq_id); 
-                    sandesha2_terminate_mgr_add_terminate_seq_msg(env, 
rm_msg_ctx, 
-                        out_seq_id, int_seq_id, storage_mgr, seq_prop_mgr, 
-                        create_seq_mgr, sender_mgr);
-                }
-            }
-        }
+        sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx, 
msgs_str, 
+            storage_mgr, sender_mgr, seq_prop_mgr);
 
         sandesha2_msg_ctx_set_paused(rm_msg_ctx, env, AXIS2_TRUE);
         if(seq_prop_mgr)
@@ -2039,7 +1982,7 @@
 }
 
 
-static long AXIS2_CALL                 
+long AXIS2_CALL                 
 sandesha2_app_msg_processor_get_prev_msg_no(
     const axutil_env_t *env,
     axis2_char_t *internal_seq_id,

Modified: 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c?rev=654609&r1=654608&r2=654609&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c 
(original)
+++ 
webservices/sandesha/trunk/c/src/msgprocessors/terminate_seq_msg_processor.c 
Thu May  8 13:13:43 2008
@@ -14,6 +14,7 @@
  * limitations under the License.
  */
 #include <sandesha2_terminate_seq_msg_processor.h>
+#include <sandesha2_app_msg_processor.h>
 #include <sandesha2_seq_property_mgr.h>
 #include <sandesha2_create_seq_mgr.h>
 #include <sandesha2_sender_mgr.h>
@@ -246,8 +247,69 @@
     spec_version = sandesha2_msg_ctx_get_rm_spec_ver(rm_msg_ctx, env);
     if(AXIS2_TRUE == sandesha2_spec_specific_consts_is_term_seq_res_reqd(env, 
             spec_version))
+    {
         sandesha2_terminate_seq_msg_processor_add_terminate_seq_res(env, 
             rm_msg_ctx, seq_id, seq_prop_mgr);
+    }
+    else
+    {
+        sandesha2_seq_ack_t *seq_ack = NULL;
+
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"came1****************************");
+        seq_ack = sandesha2_msg_ctx_get_seq_ack(rm_msg_ctx, env);
+        if(seq_ack)
+        {
+            axis2_char_t *int_seq_id = NULL;
+            axis2_char_t *out_seq_id = NULL;
+            axis2_char_t *last_out_msg_no_str = NULL;
+            long highest_out_msg_no = 0;
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"came2****************************");
+            
+            /* If there is a sequence acknowledgement element present in the 
sequence we will check
+             * whether the sequence is completed. If so send a terminate 
sequence message.
+             */
+            out_seq_id = sandesha2_identifier_get_identifier(
+                sandesha2_seq_ack_get_identifier(seq_ack, env), env);
+            int_seq_id = sandesha2_utils_get_seq_property(env, out_seq_id, 
+                    SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID, seq_prop_mgr);
+            last_out_msg_no_str = sandesha2_utils_get_seq_property(env, 
int_seq_id,
+                SANDESHA2_SEQ_PROP_LAST_OUT_MESSAGE_NO, seq_prop_mgr);
+            if(last_out_msg_no_str)
+            {
+                highest_out_msg_no = atol(last_out_msg_no_str);
+                if(last_out_msg_no_str)
+                    AXIS2_FREE(env->allocator, last_out_msg_no_str);
+            }
+            else
+            {
+                highest_out_msg_no = 
sandesha2_app_msg_processor_get_prev_msg_no(env, 
+                    int_seq_id, seq_prop_mgr);
+            }
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"highest_out_msg_no:%d****************************", highest_out_msg_no);
+            if(highest_out_msg_no > 0)
+            {
+                axis2_bool_t completed = AXIS2_FALSE;
+                axutil_array_list_t *ack_range_list = NULL;
+
+                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"highest_out_msg_no:%ld", highest_out_msg_no);
+
+                ack_range_list = sandesha2_seq_ack_get_ack_range_list(seq_ack, 
env);
+                completed = sandesha2_ack_mgr_verify_seq_completion(env, 
+                    ack_range_list, highest_out_msg_no);
+                AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"came3****************************");
+                if(completed)
+                {
+                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
"came4****************************");
+                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+                            "[sandesha2]Sequence %s is completed. So adding 
terminate msg", 
+                            out_seq_id); 
+                    sandesha2_terminate_mgr_add_terminate_seq_msg(env, 
rm_msg_ctx, 
+                        out_seq_id, int_seq_id, storage_mgr, seq_prop_mgr, 
+                        create_seq_mgr, sender_mgr);
+                }
+            }
+        }
+    }
     sandesha2_terminate_seq_msg_processor_setup_highest_msg_nums(env, 
conf_ctx, 
         storage_mgr, seq_id, rm_msg_ctx, seq_prop_mgr, create_seq_mgr, 
         sender_mgr);

Modified: webservices/sandesha/trunk/c/src/util/terminate_mgr.c
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/util/terminate_mgr.c?rev=654609&r1=654608&r2=654609&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/util/terminate_mgr.c (original)
+++ webservices/sandesha/trunk/c/src/util/terminate_mgr.c Thu May  8 13:13:43 
2008
@@ -792,15 +792,7 @@
     {
         axis2_msg_ctx_t *msg_ctx2 = NULL;
         axis2_bool_t is_svr_side = AXIS2_FALSE;
-        sandesha2_seq_t *req_seq = NULL;
-        axis2_char_t *incoming_seq_id = NULL;
 
-        /* Send an acknowledgement message with the terminate message 
sequence. */
-
-        req_seq = sandesha2_msg_ctx_get_sequence(rm_msg_ctx, env);
-        incoming_seq_id = sandesha2_identifier_get_identifier(
-            sandesha2_terminate_seq_get_identifier(req_seq, env), env);
-        sandesha2_msg_creator_add_ack_msg(env, rm_msg_ctx, incoming_seq_id, 
seq_prop_mgr);
         msg_ctx2 = sandesha2_msg_ctx_get_msg_ctx(terminate_rm_msg, env);
         is_svr_side = axis2_msg_ctx_get_server_side(msg_ctx2, env);
         axis2_op_ctx_set_response_written(axis2_msg_ctx_get_op_ctx(msg_ctx2, 
env), env, AXIS2_TRUE);



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

Reply via email to