Author: damitha
Date: Thu Jul 31 21:30:12 2008
New Revision: 681599
URL: http://svn.apache.org/viewvc?rev=681599&view=rev
Log:
Fixing memory leaks. rm_echo_single_1_0 sample is now significanlty fixed for
leaks.
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h
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/storage/sqlite/permanent_storage_mgr.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/terminate_mgr.c
Modified:
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h
URL:
http://svn.apache.org/viewvc/webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h?rev=681599&r1=681598&r2=681599&view=diff
==============================================================================
---
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h
(original)
+++
webservices/sandesha/tags/sandesha2/c/worker_thread_removed-23may2008/include/sandesha2_constants.h
Thu Jul 31 21:30:12 2008
@@ -520,6 +520,7 @@
#define SANDESHA2_POLLING_WAIT "PollingWaitTime"
#define SANDESHA2_MODULE "sandesha2"
#define SANDESHA2_ISOLATED_LAST_MSG "isolated_last_msg"
+ #define SANDESHA2_PROPERTY_STRING "propstr"
/** @} */
#ifdef __cplusplus
}
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=681599&r1=681598&r2=681599&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
Thu Jul 31 21:30:12 2008
@@ -2289,7 +2289,7 @@
axis2_char_t *rms_sequence_id = NULL;
sandesha2_sender_bean_t *app_msg_sender_bean = NULL;
long millisecs = 0;
- axutil_property_t *property = NULL;
+ /*axutil_property_t *property = NULL;*/
axis2_engine_t *engine = NULL;
sandesha2_identifier_t *identifier = NULL;
axis2_char_t *msg_id = NULL;
@@ -2562,8 +2562,8 @@
else
{
sandesha2_sender_bean_set_send(app_msg_sender_bean, env, AXIS2_TRUE);
- property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
- axis2_msg_ctx_set_property(app_msg_ctx, env,
SANDESHA2_SET_SEND_TO_TRUE, property);
+ /*property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(app_msg_ctx, env,
SANDESHA2_SET_SEND_TO_TRUE, property);*/
}
/**
@@ -3061,8 +3061,16 @@
axis2_msg_ctx_set_status_code (response_msg_ctx, env,
axis2_msg_ctx_get_status_code (msg_ctx, env));
/* To avoid a second passing through incoming handlers at op_client */
- property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
- axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_HANDLER_ALREADY_VISITED,
property);
+ property = axis2_msg_ctx_get_property(msg_ctx, env,
AXIS2_HANDLER_ALREADY_VISITED);
+ if(property)
+ {
+ axutil_property_set_value(property, env, AXIS2_VALUE_TRUE);
+ }
+ else
+ {
+ property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(msg_ctx, env,
AXIS2_HANDLER_ALREADY_VISITED, property);
+ }
axis2_msg_ctx_set_soap_envelope(response_msg_ctx, env, response_envelope);
engine = axis2_engine_create(env, conf_ctx);
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=681599&r1=681598&r2=681599&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
Thu Jul 31 21:30:12 2008
@@ -418,6 +418,7 @@
axiom_soap_envelope_t *soap_envelope = NULL;
sandesha2_msg_store_bean_t *msg_store_bean = NULL;
axis2_char_t *soap_env_str = NULL;
+ axutil_property_t *prop_property = NULL;
storage_mgr_impl = SANDESHA2_INTF_TO_IMPL(storage_mgr);
/*if(!persistent)
@@ -643,7 +644,11 @@
axis2_msg_ctx_set_wsa_action(msg_ctx, env,
sandesha2_msg_store_bean_get_action(msg_store_bean, env));
- persistent_prop_str =
sandesha2_msg_store_bean_get_persistent_property_str(msg_store_bean, env);
+ persistent_prop_str = axutil_strdup(env,
sandesha2_msg_store_bean_get_persistent_property_str(
+ msg_store_bean, env));
+
+ prop_property = axutil_property_create_with_args(env, 0, AXIS2_TRUE, 0,
persistent_prop_str);
+ axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_PROPERTY_STRING,
prop_property);
if(persistent_prop_str && 0 != axutil_strcmp("", persistent_prop_str))
{
@@ -656,6 +661,7 @@
for (index = axutil_hash_first(map, env); index; index =
axutil_hash_next(env, index))
{
axutil_property_t *property = NULL;
+ axutil_property_t *temp_property = NULL;
void *v = NULL;
const void *k = NULL;
axis2_char_t *key = NULL;
@@ -663,11 +669,17 @@
axutil_hash_this(index, &k, NULL, &v);
key = (axis2_char_t *) k;
property = (axutil_property_t *) v;
+ temp_property = axis2_msg_ctx_get_property(msg_ctx, env, key);
+ if(temp_property)
+ {
+ axutil_property_free(temp_property, env);
+ }
+
axis2_msg_ctx_set_property(msg_ctx, env, key, property);
}
axutil_hash_free(map, env);
- }
+ }
}
if(msg_store_bean)
@@ -996,6 +1008,7 @@
axis2_char_t *str)
{
axutil_array_list_t *values = NULL;
+ axis2_char_t *value = NULL;
int i = 0, size = 0;
axutil_hash_t *map = axutil_hash_make(env);
values = sandesha2_utils_split(env, str,
SANDESHA2_PERSISTANT_PROPERTY_SEPERATOR);
@@ -1003,9 +1016,13 @@
{
size = axutil_array_list_size(values, env);
}
+
+ if(1 == size)
+ {
+ value = axutil_array_list_get(values, env, 0);
+ }
- if((size % 2 != 0) || (size == 1 && 0 == axutil_strcmp("",
- axutil_array_list_get(values, env, 0))))
+ if((size % 2 != 0) || (size == 1 && !axutil_strcmp("", value)))
{
AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[sandesha2] Invalid
persistence property string");
AXIS2_ERROR_SET(env->error,
@@ -1029,10 +1046,20 @@
for(i = 0; i < size; i=i+2)
{
+ axutil_property_t *property = NULL;
axis2_char_t *key = axutil_array_list_get(values, env, i);
axis2_char_t *value = axutil_array_list_get(values, env, i+1);
- axutil_property_t *property = axutil_property_create_with_args(env, 0,
AXIS2_TRUE, 0, value);
- axutil_hash_set(map, key, AXIS2_HASH_KEY_STRING, property);
+
+ property = axutil_hash_get(map, key, AXIS2_HASH_KEY_STRING);
+ if(property)
+ {
+ axutil_property_set_value(property, env, value);
+ }
+ else
+ {
+ property = axutil_property_create_with_args(env, 0, 0, 0, value);
+ axutil_hash_set(map, key, AXIS2_HASH_KEY_STRING, property);
+ }
}
if(values)
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=681599&r1=681598&r2=681599&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
Thu Jul 31 21:30:12 2008
@@ -1070,24 +1070,22 @@
msg_ctx = sandesha2_msg_ctx_get_msg_ctx(rm_msg_ctx, env);
if(msg_ctx)
+ {
conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
- sandesha2_msg_ctx_set_msg_type(rm_msg_ctx, env,
- SANDESHA2_MSG_TYPE_CREATE_SEQ);
+ }
+
+ sandesha2_msg_ctx_set_msg_type(rm_msg_ctx, env,
SANDESHA2_MSG_TYPE_CREATE_SEQ);
/* Message will be stored in the sandesha2_transport_sender */
- property = axutil_property_create_with_args(env, AXIS2_SCOPE_REQUEST,
- AXIS2_TRUE, 0, storage_key);
- axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_MESSAGE_STORE_KEY,
- property);
+ property = axutil_property_create_with_args(env, AXIS2_SCOPE_REQUEST,
AXIS2_TRUE, 0, storage_key);
+ axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_MESSAGE_STORE_KEY,
property);
transport_out = axis2_msg_ctx_get_transport_out_desc(msg_ctx, env);
property = axutil_property_create_with_args(env, 3, 0,
axis2_transport_out_desc_free_void_arg, transport_out);
- axis2_msg_ctx_set_property(msg_ctx, env,
- SANDESHA2_ORIGINAL_TRANSPORT_OUT_DESC, property);
+ axis2_msg_ctx_set_property(msg_ctx, env,
SANDESHA2_ORIGINAL_TRANSPORT_OUT_DESC, property);
- property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
- axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_SET_SEND_TO_TRUE,
- property);
+ /*property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(msg_ctx, env, SANDESHA2_SET_SEND_TO_TRUE,
property);*/
sandesha2_transport_out = sandesha2_utils_get_transport_out(env);
axis2_msg_ctx_set_transport_out_desc(msg_ctx, env,
sandesha2_transport_out);
/*Sending the message once through the sandesha2_transport_sender */
@@ -1102,8 +1100,12 @@
{
status = axis2_engine_send(engine, env, msg_ctx);
}
+
if(engine)
+ {
axis2_engine_free(engine, env);
+ }
+
return status;
}
@@ -1168,7 +1170,8 @@
while(ptr)
{
ptr[0] = AXIS2_EOLN;
- value = axutil_strdup(env, str);
+ /*value = axutil_strdup(env, str);*/
+ value = str;
if(value && axutil_strcmp(value, ""))
{
axutil_array_list_add(list, env, value);
@@ -1178,7 +1181,8 @@
ptr = axutil_strstr(str, pattern);
}
- value = axutil_strdup(env, str);
+ /*value = axutil_strdup(env, str);*/
+ value = str;
if(value && axutil_strcmp(value, ""))
{
axutil_array_list_add(list, env, value);
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=681599&r1=681598&r2=681599&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
Thu Jul 31 21:30:12 2008
@@ -997,8 +997,8 @@
property = axutil_property_create_with_args(env, 0, AXIS2_TRUE, 0, key);
axis2_msg_ctx_set_property(terminate_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(terminate_msg_ctx, env,
SANDESHA2_SET_SEND_TO_TRUE, property);
+ /*property = axutil_property_create_with_args(env, 0, 0, 0,
AXIS2_VALUE_TRUE);
+ axis2_msg_ctx_set_property(terminate_msg_ctx, env,
SANDESHA2_SET_SEND_TO_TRUE, property);*/
reply_to_epr = axis2_msg_ctx_get_to(ack_msg_ctx, env);
if(reply_to_epr)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]