Author: damitha
Date: Sat Feb 16 19:20:43 2008
New Revision: 628408
URL: http://svn.apache.org/viewvc?rev=628408&view=rev
Log:
In single channel echo 1.0 terminate message from server to the client is not
processed.
Fixed this
Modified:
webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h
webservices/sandesha/trunk/c/include/sandesha2_constants.h
webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
webservices/sandesha/trunk/c/src/workers/sender_worker.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=628408&r1=628407&r2=628408&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h
(original)
+++ webservices/sandesha/trunk/c/include/sandesha2_app_msg_processor.h Sat Feb
16 19:20:43 2008
@@ -32,6 +32,8 @@
#endif
struct sandesha2_seq_property_mgr;
+struct sandesha2_sender_mgr;
+struct sandesha2_storage_mgr;
/** @defgroup sandesha2_app_msg_processor
* @ingroup sandesha2_msgprocessors
@@ -47,6 +49,8 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *msg_ctx,
axis2_char_t *msg_str,
+ struct sandesha2_storage_mgr *storage_mgr,
+ struct sandesha2_sender_mgr *sender_mgr,
struct sandesha2_seq_property_mgr *seq_prop_mgr);
/** @} */
#ifdef __cplusplus
Modified: webservices/sandesha/trunk/c/include/sandesha2_constants.h
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/include/sandesha2_constants.h?rev=628408&r1=628407&r2=628408&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/include/sandesha2_constants.h (original)
+++ webservices/sandesha/trunk/c/include/sandesha2_constants.h Sat Feb 16
19:20:43 2008
@@ -236,6 +236,8 @@
#define SANDESHA2_SEQ_PROP_OUT_SEQ_ID "OutSequenceId"
#define SANDESHA2_SEQ_PROP_INTERNAL_SEQ_ID "TempSequenceId"
+
+ #define SANDESHA2_SEQ_PROP_SPECIAL_INTERNAL_SEQ_ID "SpecialIntSequenceId"
#define SANDESHA2_SEQ_PROP_REPLY_TO_EPR "ReplyToEPR"
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=628408&r1=628407&r2=628408&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c
(original)
+++ webservices/sandesha/trunk/c/src/msgprocessors/app_msg_processor.c Sat Feb
16 19:20:43 2008
@@ -206,6 +206,7 @@
axis2_char_t *msgs_str = "";
axis2_char_t msg_num_str[32];
sandesha2_invoker_mgr_t *invoker_mgr = NULL;
+ sandesha2_sender_mgr_t *sender_mgr = NULL;
sandesha2_next_msg_mgr_t *next_msg_mgr = NULL;
sandesha2_create_seq_mgr_t *create_seq_mgr = NULL;
sandesha2_next_msg_bean_t *next_msg_bean = NULL;
@@ -302,6 +303,7 @@
create_seq_mgr = sandesha2_permanent_create_seq_mgr_create(env, dbname);
next_msg_mgr = sandesha2_permanent_next_msg_mgr_create(env, dbname);
invoker_mgr = sandesha2_permanent_invoker_mgr_create(env, dbname);
+ sender_mgr = sandesha2_permanent_sender_mgr_create(env, dbname);
seq = sandesha2_msg_ctx_get_sequence(rm_msg_ctx, env);
sandesha2_seq_set_must_understand(seq, env, AXIS2_FALSE);
str_seq_id = sandesha2_identifier_get_identifier(
@@ -769,7 +771,7 @@
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]back_channel_free true");
sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
msgs_str,
- seq_prop_mgr);
+ storage_mgr, sender_mgr, seq_prop_mgr);
}
else if(sandesha2_utils_is_single_channel(env, rm_version, acks_to_str))
{
@@ -779,7 +781,7 @@
else
{
sandesha2_app_msg_processor_send_ack_if_reqd(env, rm_msg_ctx,
msgs_str,
- seq_prop_mgr);
+ storage_mgr, sender_mgr, seq_prop_mgr);
}
if(rm_version)
AXIS2_FREE(env->allocator, rm_version);
@@ -1365,6 +1367,8 @@
const axutil_env_t *env,
sandesha2_msg_ctx_t *rm_msg_ctx,
axis2_char_t *msg_str,
+ sandesha2_storage_mgr_t *storage_mgr,
+ sandesha2_sender_mgr_t *sender_mgr,
sandesha2_seq_property_mgr_t *seq_prop_mgr)
{
sandesha2_seq_t *seq = NULL;
@@ -1372,8 +1376,10 @@
axis2_conf_ctx_t *conf_ctx = NULL;
sandesha2_ack_requested_t *ack_requested = NULL;
sandesha2_msg_ctx_t *ack_rm_msg = NULL;
+ axis2_msg_ctx_t *ack_msg_ctx = NULL;
axis2_msg_ctx_t *msg_ctx = NULL;
axis2_bool_t sent = AXIS2_FALSE;
+ sandesha2_seq_property_bean_t *int_seq_bean = NULL;
AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI,
"[Sandesha2]Entry:sandesha2_app_msg_processor_send_ack_if_reqd");
@@ -1401,13 +1407,72 @@
}
ack_rm_msg = sandesha2_ack_mgr_generate_ack_msg(env, rm_msg_ctx, seq_id,
seq_prop_mgr);
+ ack_msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ack_rm_msg, env);
+ int_seq_bean = sandesha2_seq_property_mgr_retrieve(seq_prop_mgr, env,
+ seq_id, SANDESHA2_SEQ_PROP_SPECIAL_INTERNAL_SEQ_ID);
+ /* Following code block send the ack messages through sender. If we
comment this
+ * it will be sent directly avoiding the sender. We will enter this block
only
+ * in application client side when sequence offer is on.
+ */
+ if(int_seq_bean)
+ {
+ axis2_status_t status = AXIS2_FAILURE;
+ axis2_transport_out_desc_t *transport_out = NULL;
+ long send_time = -1;
+ axis2_char_t *key = NULL;
+ axutil_property_t *property = NULL;
+ sandesha2_sender_bean_t *ack_bean = NULL;
+ axis2_char_t *int_seq_id = NULL;
+ key = axutil_uuid_gen(env);
+ ack_bean = sandesha2_sender_bean_create(env);
+ sandesha2_sender_bean_set_msg_ctx_ref_key(ack_bean, env, key);
+ sandesha2_storage_mgr_store_msg_ctx(storage_mgr, env, key,
+ ack_msg_ctx);
+ send_time = sandesha2_utils_get_current_time_in_millis(env);
+ sandesha2_sender_bean_set_time_to_send(ack_bean, env, send_time);
+ sandesha2_sender_bean_set_msg_id(ack_bean, env,
+ sandesha2_msg_ctx_get_msg_id(ack_rm_msg, env));
+ sandesha2_sender_bean_set_send(ack_bean, env, AXIS2_TRUE);
+ int_seq_id = sandesha2_seq_property_bean_get_value(int_seq_bean, env);
+ sandesha2_sender_bean_set_internal_seq_id(ack_bean, env, int_seq_id);
+ sandesha2_sender_bean_set_seq_id(ack_bean, env, seq_id);
+ property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_FALSE);
+ sandesha2_msg_ctx_set_property(ack_rm_msg, env,
+ SANDESHA2_QUALIFIED_FOR_SENDING, property);
+ sandesha2_sender_bean_set_msg_type(ack_bean, env,
+ SANDESHA2_MSG_TYPE_ACK);
+ sandesha2_sender_bean_set_resend(ack_bean, env, AXIS2_FALSE);
+ sandesha2_sender_mgr_insert(sender_mgr, env, ack_bean);
+ if(ack_bean)
+ sandesha2_sender_bean_free(ack_bean, env);
+ transport_out = axis2_msg_ctx_get_transport_out_desc(ack_msg_ctx, env);
+ property = axutil_property_create_with_args(env, 0, 0,
+ axis2_transport_out_desc_free_void_arg, transport_out);
+ axis2_msg_ctx_set_property(ack_msg_ctx, env,
+ SANDESHA2_ORIGINAL_TRANSPORT_OUT_DESC, property);
+ property = axutil_property_create_with_args(env, 0, AXIS2_TRUE, 0,
key);
+ axis2_msg_ctx_set_property(ack_msg_ctx, env,
SANDESHA2_MESSAGE_STORE_KEY,
+ property);
+ property = axutil_property_create_with_args(env, 0, 0, 0,
+ AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(ack_msg_ctx, env,
SANDESHA2_SET_SEND_TO_TRUE,
+ property);
+ axis2_msg_ctx_set_transport_out_desc(ack_msg_ctx, env,
+ sandesha2_utils_get_transport_out(env));
+ {
+ axis2_endpoint_ref_t *reply_to_epr = NULL;
+ reply_to_epr = axis2_msg_ctx_get_to(msg_ctx, env);
+ if(reply_to_epr)
+ axis2_msg_ctx_set_reply_to(ack_msg_ctx, env, reply_to_epr);
+ }
+ sandesha2_seq_property_bean_free(int_seq_bean, env);
+ }
if(ack_rm_msg)
{
axis2_engine_t *engine = NULL;
engine = axis2_engine_create(env, conf_ctx);
- msg_ctx = sandesha2_msg_ctx_get_msg_ctx(ack_rm_msg, env);
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]axis2_engine_send");
- sent = axis2_engine_send(engine, env, msg_ctx);
+ sent = axis2_engine_send(engine, env, ack_msg_ctx);
if(ack_rm_msg)
sandesha2_msg_ctx_free(ack_rm_msg, env);
if(engine)
Modified:
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
URL:
http://svn.apache.org/viewvc/webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c?rev=628408&r1=628407&r2=628408&view=diff
==============================================================================
---
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
(original)
+++
webservices/sandesha/trunk/c/src/msgprocessors/create_seq_res_msg_processor.c
Sat Feb 16 19:20:43 2008
@@ -313,6 +313,7 @@
accept = sandesha2_create_seq_res_get_accept(csr_part, env);
if(accept)
{
+ sandesha2_seq_property_bean_t *special_int_seq_bean = NULL;
sandesha2_seq_property_bean_t *offerd_seq_bean = NULL;
axis2_char_t *offered_seq_id = NULL;
axis2_endpoint_ref_t *acks_to_epr = NULL;
@@ -350,6 +351,14 @@
}
offered_seq_id = sandesha2_seq_property_bean_get_value(offerd_seq_bean,
env);
+ special_int_seq_bean =
sandesha2_seq_property_bean_create_with_data(env,
+ offered_seq_id, SANDESHA2_SEQ_PROP_SPECIAL_INTERNAL_SEQ_ID,
internal_seq_id);
+ if(special_int_seq_bean)
+ {
+ sandesha2_seq_property_mgr_insert(seq_prop_mgr, env,
+ special_int_seq_bean);
+ sandesha2_seq_property_bean_free(special_int_seq_bean, env);
+ }
acks_to_epr = sandesha2_address_get_epr(sandesha2_acks_to_get_address(
sandesha2_accept_get_acks_to(accept, env), env), env);
acks_to_bean = sandesha2_seq_property_bean_create(env);
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?rev=628408&r1=628407&r2=628408&view=diff
==============================================================================
--- webservices/sandesha/trunk/c/src/workers/sender_worker.c (original)
+++ webservices/sandesha/trunk/c/src/workers/sender_worker.c Sat Feb 16
19:20:43 2008
@@ -358,7 +358,8 @@
{
AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
"[sandesha2]message of msg_type:%d successfully sent", msg_type);
- if(AXIS2_FALSE == axis2_msg_ctx_get_server_side(msg_ctx, env))
+ if(AXIS2_FALSE == axis2_msg_ctx_get_server_side(msg_ctx, env) ||
+ msg_type == SANDESHA2_MSG_TYPE_ACK)
sandesha2_sender_worker_check_for_sync_res(env, msg_ctx,
storage_mgr, msg_type);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]