axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r368006 - in /webservices/axis2/trunk/c: include/ modules/core/clientapi/ modules/core/deployment/ modules/core/description/ modules/core/engine/ modules/core/phaseresolver/ test/unit/core/description/ test/unit/core/phaseresolver/
Date Wed, 11 Jan 2006 10:58:22 GMT
Author: damitha
Date: Wed Jan 11 02:57:58 2006
New Revision: 368006

URL: http://svn.apache.org/viewcvs?rev=368006&view=rev
Log:
There is a bug in resizing the array list(a seg fault occur)
To avoid that while initial testing set the default array create size to 20(where it
was 0). This is a temporary solution until the bug is fixed.
Also renamed the axis2_op_create_with_name to axis2_op_create_with_qname


Modified:
    webservices/axis2/trunk/c/include/axis2_op.h
    webservices/axis2/trunk/c/modules/core/clientapi/call.c
    webservices/axis2/trunk/c/modules/core/clientapi/msg_sender.c
    webservices/axis2/trunk/c/modules/core/deployment/phases_info.c
    webservices/axis2/trunk/c/modules/core/description/flow.c
    webservices/axis2/trunk/c/modules/core/description/op.c
    webservices/axis2/trunk/c/modules/core/description/param_container.c
    webservices/axis2/trunk/c/modules/core/description/svc.c
    webservices/axis2/trunk/c/modules/core/description/svc_grp.c
    webservices/axis2/trunk/c/modules/core/engine/conf.c
    webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c
    webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c
    webservices/axis2/trunk/c/test/unit/core/description/test_op.c
    webservices/axis2/trunk/c/test/unit/core/description/test_svc.c
    webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c

Modified: webservices/axis2/trunk/c/include/axis2_op.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_op.h?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_op.h (original)
+++ webservices/axis2/trunk/c/include/axis2_op.h Wed Jan 11 02:57:58 2006
@@ -401,7 +401,7 @@
  * @return pointer to newly created op
  */
 AXIS2_DECLARE(axis2_op_t *)
-axis2_op_create_with_name (axis2_env_t **env, 
+axis2_op_create_with_qname (axis2_env_t **env, 
                             axis2_qname_t *name);
 
 /** 

Modified: webservices/axis2/trunk/c/modules/core/clientapi/call.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/call.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/call.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/call.c Wed Jan 11 02:57:58 2006
@@ -1017,7 +1017,7 @@
     {
         axis2_svc_t *svc = NULL;
         
-        op = axis2_op_create_with_name(env, op_qname);
+        op = axis2_op_create_with_qname(env, op_qname);
         AXIS2_OP_SET_REMAINING_PHASES_INFLOW(op, env, 
             AXIS2_OP_GET_REMAINING_PHASES_INFLOW(call_impl->op_template, env));
         AXIS2_OP_SET_PHASES_OUTFLOW(op, env, 

Modified: webservices/axis2/trunk/c/modules/core/clientapi/msg_sender.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/clientapi/msg_sender.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/clientapi/msg_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/clientapi/msg_sender.c Wed Jan 11 02:57:58 2006
@@ -297,7 +297,7 @@
 	op = AXIS2_SVC_GET_OP_WITH_QNAME(svc, env, op_qname); 
 	if(NULL == op)
 	{
-		op = axis2_op_create_with_name(env, op_qname);
+		op = axis2_op_create_with_qname(env, op_qname);
 		if(NULL == op)
 		{
 			return AXIS2_FAILURE;

Modified: webservices/axis2/trunk/c/modules/core/deployment/phases_info.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/deployment/phases_info.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/deployment/phases_info.c (original)
+++ webservices/axis2/trunk/c/modules/core/deployment/phases_info.c Wed Jan 11 02:57:58 2006
@@ -302,7 +302,7 @@
     AXIS2_FUNC_PARAM_CHECK(phases_info, env, NULL);
     
     info_impl = AXIS2_INTF_TO_IMPL(phases_info);
-    op_in_phases = axis2_array_list_create(env, 0);
+    op_in_phases = axis2_array_list_create(env, 20);
     phase = axis2_phase_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
     
     status = AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
@@ -354,7 +354,7 @@
     AXIS2_FUNC_PARAM_CHECK(phases_info, env, NULL);
     
     info_impl = AXIS2_INTF_TO_IMPL(phases_info);
-    op_out_phases = axis2_array_list_create(env, 0);
+    op_out_phases = axis2_array_list_create(env, 20);
     for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(info_impl->out_phases, env); i++) 
     {
         phase_name = (axis2_char_t *) AXIS2_ARRAY_LIST_GET(info_impl->out_phases, env,
i);
@@ -413,7 +413,7 @@
     AXIS2_FUNC_PARAM_CHECK(phases_info, env, NULL);
     
     info_impl = AXIS2_INTF_TO_IMPL(phases_info);
-    op_in_faultphases = axis2_array_list_create(env, 0);
+    op_in_faultphases = axis2_array_list_create(env, 20);
     
     for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(info_impl->in_faultphases, env); i++) 
     {
@@ -447,7 +447,7 @@
     AXIS2_FUNC_PARAM_CHECK(phases_info, env, NULL);
     
     info_impl = AXIS2_INTF_TO_IMPL(phases_info);
-    op_out_faultphases = axis2_array_list_create(env, 0);
+    op_out_faultphases = axis2_array_list_create(env, 20);
     
     for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(info_impl->out_faultphases, env); i++) 
     {

Modified: webservices/axis2/trunk/c/modules/core/description/flow.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/flow.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/flow.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/flow.c Wed Jan 11 02:57:58 2006
@@ -100,15 +100,27 @@
 axis2_status_t AXIS2_CALL
 axis2_flow_free (axis2_flow_t *flow, axis2_env_t **env)
 {
+    axis2_flow_impl_t *flow_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(flow, env, AXIS2_FAILURE);
     
     if(NULL != flow->ops)
+    {
         AXIS2_FREE((*env)->allocator, flow->ops);
+        flow->ops = NULL;
+    }
     
-    if(NULL != AXIS2_INTF_TO_IMPL(flow)->list)
-        AXIS2_ARRAY_LIST_FREE(AXIS2_INTF_TO_IMPL(flow)->list, env);
+    if(NULL != flow_impl->list)
+    {
+        AXIS2_ARRAY_LIST_FREE(flow_impl->list, env);
+        flow_impl->list = NULL;
+    }
     
-    AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(flow));
+    if(flow_impl)
+    {
+        AXIS2_FREE((*env)->allocator, flow_impl);
+        flow_impl = NULL;
+    }
     
     return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/modules/core/description/op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/op.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/op.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/op.c Wed Jan 11 02:57:58 2006
@@ -376,35 +376,35 @@
         return NULL;		
 	}
 
-    op_impl->remaining_phases_inflow = axis2_array_list_create(env, 0);
+    op_impl->remaining_phases_inflow = axis2_array_list_create(env, 20);
     if(NULL == op_impl->remaining_phases_inflow)
     {
         axis2_op_free(&(op_impl->op), env);
         return NULL;
     }
     
-    op_impl->phases_outflow = axis2_array_list_create(env, 0);
+    op_impl->phases_outflow = axis2_array_list_create(env, 20);
     if(NULL == op_impl->phases_outflow)
     {
         axis2_op_free(&(op_impl->op), env);
         return NULL;
     }
     
-    op_impl->phases_in_fault_flow = axis2_array_list_create(env, 0);
+    op_impl->phases_in_fault_flow = axis2_array_list_create(env, 20);
     if(NULL == op_impl->phases_in_fault_flow)
     {
         axis2_op_free(&(op_impl->op), env);
         return NULL;
     }
     
-    op_impl->modulerefs = axis2_array_list_create(env, 0);
+    op_impl->modulerefs = axis2_array_list_create(env, 20);
     if(NULL == op_impl->modulerefs)
     {
         axis2_op_free(&(op_impl->op), env);
         return NULL;
     }
     
-    op_impl->phases_out_fault_flow = axis2_array_list_create(env, 0);
+    op_impl->phases_out_fault_flow = axis2_array_list_create(env, 20);
     if(NULL == op_impl->phases_out_fault_flow)
     {
         axis2_op_free(&(op_impl->op), env);
@@ -416,18 +416,19 @@
     
     param_container_l = axis2_param_container_create(env);
     if(NULL == param_container_l)
+    {
         return NULL;
+    }
     AXIS2_WSDL_COMPONENT_SET_COMPONENT_PROPERTY(op_impl->op.wsdl_op->
         extensible_component->wsdl_component, env, AXIS2_PARAMETER_KEY, 
             param_container_l);
     
-    array_list_l = axis2_array_list_create(env, 0);
+    array_list_l = axis2_array_list_create(env, 20);
     if(NULL == array_list_l) return NULL;
     AXIS2_WSDL_COMPONENT_SET_COMPONENT_PROPERTY(op_impl->op.wsdl_op->
         extensible_component->wsdl_component, env, AXIS2_MODULEREF_KEY, array_list_l);
     
-    op_impl->op.ops = AXIS2_MALLOC((*env)->allocator, 
-        sizeof(axis2_op_ops_t));
+    op_impl->op.ops = AXIS2_MALLOC((*env)->allocator, sizeof(axis2_op_ops_t));
 	if(NULL == op_impl->op.ops)
 	{
         axis2_op_free(&(op_impl->op), env);
@@ -496,7 +497,7 @@
 }
 
 axis2_op_t * AXIS2_CALL
-axis2_op_create_with_name (axis2_env_t **env, axis2_qname_t *qname)
+axis2_op_create_with_qname (axis2_env_t **env, axis2_qname_t *qname)
 {
 	axis2_op_impl_t *op_impl = NULL;
     axis2_status_t status = AXIS2_FAILURE;
@@ -597,20 +598,20 @@
     if(NULL != op_impl->remaining_phases_inflow)
     {
         printf("came14\n");
-        void *val = NULL;
         int i = 0;
-        for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(op_impl->remaining_phases_inflow, env);
i++)
+        int size = 0;
+        size = AXIS2_ARRAY_LIST_SIZE(op_impl->remaining_phases_inflow, env);
+        for (i = 0; i < size; i++)
         {
-            struct axis2_phase *phase = NULL;
-            phase = AXIS2_ARRAY_LIST_GET(op_impl->remaining_phases_inflow, env, i);
-            
-            phase = (struct axis2_phase *) val;
+            axis2_phase_t *phase = NULL;
+            phase = AXIS2_ARRAY_LIST_GET(op_impl->remaining_phases_inflow, env, 
+                i);
             if (phase)
-               AXIS2_PHASE_FREE (phase, env);
-            
-            val = NULL;
-            phase = NULL;
-               
+            {
+                AXIS2_PHASE_FREE (phase, env);
+                phase = NULL;
+            }
+      
         }
         AXIS2_ARRAY_LIST_FREE(op_impl->remaining_phases_inflow, env);
         op_impl->remaining_phases_inflow = NULL;
@@ -619,19 +620,18 @@
     if(NULL != op_impl->phases_outflow)
     {
         printf("came15\n");
-        void *val = NULL;
         int i = 0;
-        for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(op_impl->phases_outflow, env); i++)
+        int size = 0;
+        size = AXIS2_ARRAY_LIST_SIZE(op_impl->phases_outflow, env);
+        for (i = 0; i < size; i++)
         {
-            struct axis2_phase *phase = NULL;
+            axis2_phase_t *phase = NULL;
             phase = AXIS2_ARRAY_LIST_GET(op_impl->phases_outflow, env, i);
-            
-            phase = (struct axis2_phase *) val;
             if (phase)
-               AXIS2_PHASE_FREE (phase, env);
-            
-            val = NULL;
-            phase = NULL;
+            {
+                AXIS2_PHASE_FREE (phase, env);
+                phase = NULL;
+            }
                
         }
         AXIS2_ARRAY_LIST_FREE(op_impl->phases_outflow, env);
@@ -641,22 +641,19 @@
     if(NULL != op_impl->phases_in_fault_flow)
     {
         printf("came16\n");
-        void *val = NULL;
         int i = 0;
         int size = 0;
         size = AXIS2_ARRAY_LIST_SIZE(op_impl->phases_in_fault_flow, env);
         printf("size:%d\n", size);
         for (i = 0; i < size; i++)
         {
-            struct axis2_phase *phase = NULL;
+            axis2_phase_t *phase = NULL;
             phase = AXIS2_ARRAY_LIST_GET(op_impl->phases_in_fault_flow, env, i);
-            
-            phase = (struct axis2_phase *) val;
             if (phase)
-               AXIS2_PHASE_FREE (phase, env);
-            
-            val = NULL;
-            phase = NULL;
+            {
+                AXIS2_PHASE_FREE (phase, env);
+                phase = NULL;
+            }
                
         }
         AXIS2_ARRAY_LIST_FREE(op_impl->phases_in_fault_flow, env);
@@ -665,7 +662,6 @@
     
     if(NULL != op_impl->phases_out_fault_flow)
     {
-        void *val = NULL;
         int i = 0;
         int size = 0;
         printf("came17\n");
@@ -673,38 +669,32 @@
         printf("size:%d\n", size);
         for (i = 0; i < size; i++)
         {
-            struct axis2_phase *phase = NULL;
+            axis2_phase_t *phase = NULL;
             phase = AXIS2_ARRAY_LIST_GET(op_impl->phases_out_fault_flow, env, i);
-            
-            phase = (struct axis2_phase *) val;
             if (phase)
-               AXIS2_PHASE_FREE (phase, env);
-            
-            val = NULL;
-            phase = NULL;
-               
+            {
+                AXIS2_PHASE_FREE (phase, env);
+                phase = NULL;
+            }
+              
         }
-        AXIS2_ARRAY_LIST_FREE(op_impl->phases_out_fault_flow,
-            env);
+        AXIS2_ARRAY_LIST_FREE(op_impl->phases_out_fault_flow, env);
         op_impl->phases_out_fault_flow = NULL;
     }
     
     if(NULL != op_impl->modulerefs)
     {
-        void *val = NULL;
         int i = 0;
         for (i = 0; i < AXIS2_ARRAY_LIST_SIZE(op_impl->modulerefs, env); i++)
         {
             axis2_qname_t *module_ref = NULL;
             module_ref = AXIS2_ARRAY_LIST_GET(op_impl->modulerefs, env, i);
             
-            module_ref = (axis2_qname_t *) val;
             if (module_ref)
-               AXIS2_QNAME_FREE (module_ref, env);
-            
-            val = NULL;
-            module_ref = NULL;
-               
+            {
+                AXIS2_QNAME_FREE (module_ref, env);
+                module_ref = NULL;
+            }       
         }
         AXIS2_ARRAY_LIST_FREE(op_impl->modulerefs, env);
         op_impl->modulerefs = NULL;
@@ -943,11 +933,9 @@
         
     AXIS2_FUNC_PARAM_CHECK(op, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, moduleref, AXIS2_FAILURE);
-    printf("came20\n");
     collection_module = (axis2_array_list_t *) 
         AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(op->wsdl_op->
         extensible_component->wsdl_component, env, AXIS2_MODULEREF_KEY);
-    printf("came21\n");
     size = AXIS2_ARRAY_LIST_SIZE(collection_module, env);
     printf("collection_module size:%d\n", size);
     if(AXIS2_SUCCESS != AXIS2_ERROR_GET_STATUS_CODE((*env)->error))
@@ -1260,10 +1248,12 @@
                                                 axis2_env_t **env,
                                                 axis2_array_list_t *list) 
 {
+    axis2_op_impl_t *op_impl = NULL;
+    
     AXIS2_FUNC_PARAM_CHECK(op, env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, list, AXIS2_FAILURE);
+    op_impl = AXIS2_INTF_TO_IMPL(op);
     
-    axis2_op_impl_t *op_impl = AXIS2_INTF_TO_IMPL(op);
     if(op_impl->remaining_phases_inflow)
     {
         void *val = NULL;

Modified: webservices/axis2/trunk/c/modules/core/description/param_container.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/param_container.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/param_container.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/param_container.c Wed Jan 11 02:57:58
2006
@@ -189,7 +189,7 @@
     axis2_hash_index_t *index_i = 0;
     axis2_status_t status = AXIS2_FAILURE;
     /* create an array list with the initial default capacity */
-    axis2_array_list_t *array_list_l = axis2_array_list_create(env, 0);
+    axis2_array_list_t *array_list_l = axis2_array_list_create(env, 20);
     void *value = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(param_container, env, NULL);

Modified: webservices/axis2/trunk/c/modules/core/description/svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/svc.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc.c Wed Jan 11 02:57:58 2006
@@ -324,7 +324,7 @@
 	}
     
     /** Create modle list of default size */
-    svc_impl->module_list = axis2_array_list_create(env, 0);
+    svc_impl->module_list = axis2_array_list_create(env, 20);
     if(NULL == svc_impl->module_list)
     {
         axis2_svc_free(&(svc_impl->svc), env);
@@ -371,7 +371,7 @@
         return NULL;
     }
     
-    array_list_l = axis2_array_list_create(env, 0);
+    array_list_l = axis2_array_list_create(env, 20);
     if(NULL == array_list_l)
     {
         axis2_svc_free(&(svc_impl->svc), env);

Modified: webservices/axis2/trunk/c/modules/core/description/svc_grp.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/description/svc_grp.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/description/svc_grp.c (original)
+++ webservices/axis2/trunk/c/modules/core/description/svc_grp.c Wed Jan 11 02:57:58 2006
@@ -168,7 +168,7 @@
         return NULL;
     }
     
-    svc_grp_impl->modules = axis2_array_list_create(env, 0);
+    svc_grp_impl->modules = axis2_array_list_create(env, 20);
     if(NULL == svc_grp_impl->modules)
     {
         axis2_svc_grp_free(&(svc_grp_impl->svc_grp), env);
@@ -176,7 +176,7 @@
         return NULL;
     }
     
-    svc_grp_impl->module_list = axis2_array_list_create(env, 0);
+    svc_grp_impl->module_list = axis2_array_list_create(env, 20);
     if(NULL == svc_grp_impl->module_list)
     {
         axis2_svc_grp_free(&(svc_grp_impl->svc_grp), env);
@@ -729,7 +729,7 @@
     svc_grp_impl = AXIS2_INTF_TO_IMPL(svc_grp);
     if(!svc_grp_impl->module_list)
     {
-        svc_grp_impl->module_list = axis2_array_list_create(env, 0);
+        svc_grp_impl->module_list = axis2_array_list_create(env, 20);
         if(!svc_grp_impl->module_list)
             return AXIS2_FAILURE;
     }

Modified: webservices/axis2/trunk/c/modules/core/engine/conf.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/engine/conf.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/modules/core/engine/conf.c Wed Jan 11 02:57:58 2006
@@ -345,7 +345,7 @@
         return NULL;
 	}
     
-    config_impl->engaged_modules = axis2_array_list_create(env, 0);		
+    config_impl->engaged_modules = axis2_array_list_create(env, 20);		
 	if(NULL == config_impl->engaged_modules)
 	{
         axis2_conf_free(&(config_impl->conf), env);
@@ -354,7 +354,7 @@
 	}
     
     config_impl->in_phases_upto_and_including_post_dispatch = 
-        axis2_array_list_create(env, 0);		
+        axis2_array_list_create(env, 20);		
 	if(NULL == config_impl->in_phases_upto_and_including_post_dispatch)
 	{
         axis2_conf_free(&(config_impl->conf), env);
@@ -392,7 +392,7 @@
         }
     }
     
-    config_impl->out_phases = axis2_array_list_create(env, 0);		
+    config_impl->out_phases = axis2_array_list_create(env, 20);		
 	if(NULL == config_impl->out_phases)
 	{
         axis2_conf_free(&(config_impl->conf), env);
@@ -400,7 +400,7 @@
         return NULL;
 	}
     
-    config_impl->in_faultphases = axis2_array_list_create(env, 0);		
+    config_impl->in_faultphases = axis2_array_list_create(env, 20);		
 	if(NULL == config_impl->in_faultphases)
 	{
         axis2_conf_free(&(config_impl->conf), env);
@@ -408,7 +408,7 @@
         return NULL;
 	}
     
-    config_impl->out_faultphases = axis2_array_list_create(env, 0);		
+    config_impl->out_faultphases = axis2_array_list_create(env, 20);		
 	if(NULL == config_impl->out_faultphases)
 	{
         axis2_conf_free(&(config_impl->conf), env);

Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/phase_holder.c Wed Jan 11 02:57:58
2006
@@ -145,8 +145,10 @@
     }
     
     if(phase_holder_impl)
+    {
         AXIS2_FREE((*env)->allocator, phase_holder_impl);
-    phase_holder_impl = NULL;
+        phase_holder_impl = NULL;
+    }
     
 	return AXIS2_SUCCESS;
 }
@@ -164,21 +166,23 @@
 {
     int size = 0;
     int i = 0;
-    struct axis2_phase *phase = NULL;
+    axis2_phase_t *phase = NULL;
+    axis2_phase_holder_impl_t *phase_holder_impl = NULL;
     
     AXIS2_FUNC_PARAM_CHECK(phase_holder, env, AXIS2_FALSE);
     AXIS2_PARAM_CHECK((*env)->error, phase_name, AXIS2_FALSE);
-    
-    axis2_phase_holder_impl_t *phase_holder_impl = AXIS2_INTF_TO_IMPL(phase_holder);
+    phase_holder_impl = AXIS2_INTF_TO_IMPL(phase_holder);
     
     size = AXIS2_ARRAY_LIST_SIZE(phase_holder_impl->phase_list, env);
     
     for (i = 0; i < size; i++) 
     {
-        phase = (struct axis2_phase *) AXIS2_ARRAY_LIST_GET(phase_holder_impl->
-            phase_list, env, i);
+        axis2_char_t *phase_name_l = NULL;
         
-        if (0 == AXIS2_STRCMP(AXIS2_PHASE_GET_NAME(phase, env), phase_name))
+        phase = (axis2_phase_t *) AXIS2_ARRAY_LIST_GET(phase_holder_impl->
+            phase_list, env, i);
+        phase_name_l = AXIS2_PHASE_GET_NAME(phase, env);
+        if (0 == AXIS2_STRCMP(phase_name_l, phase_name))
         {
             return AXIS2_TRUE;
         }
@@ -195,7 +199,7 @@
 axis2_status_t AXIS2_CALL
 axis2_phase_holder_add_handler(axis2_phase_holder_t *phase_holder, 
                                 axis2_env_t **env,
-                                struct axis2_handler_desc *handler) 
+                                axis2_handler_desc_t *handler) 
 {
     axis2_char_t *phase_name = NULL;
     axis2_status_t status = AXIS2_FAILURE;
@@ -205,13 +209,15 @@
     
     phase_name = AXIS2_PHASE_RULE_GET_NAME(
         AXIS2_HANDLER_DESC_GET_RULES(handler, env), env);
-    
     if (AXIS2_TRUE == axis2_phase_holder_is_phase_exist(phase_holder, env, 
             phase_name)) 
     {
-        status = AXIS2_PHASE_ADD_HANDLER_DESC(axis2_phase_holder_get_phase(phase_holder,

-            env, phase_name), env, handler);
-    } else 
+        axis2_phase_t *phase = NULL;
+        
+        phase = axis2_phase_holder_get_phase(phase_holder, env, phase_name);
+        status = AXIS2_PHASE_ADD_HANDLER_DESC(phase, env, handler);
+    } 
+    else 
     {
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_PHASE, AXIS2_FAILURE);
         return AXIS2_FAILURE;
@@ -244,9 +250,11 @@
     
     for (i = 0; i < size; i++) 
     {
-        phase = (struct axis2_phase *) AXIS2_ARRAY_LIST_GET(phase_holder_impl->
+        axis2_char_t *phase_name_l = NULL;
+        phase = (axis2_phase_t *) AXIS2_ARRAY_LIST_GET(phase_holder_impl->
             phase_list, env, i);
-        if(0 == AXIS2_STRCMP(AXIS2_PHASE_GET_NAME(phase, env), phase_name))
+        phase_name_l = AXIS2_PHASE_GET_NAME(phase, env);
+        if(0 == AXIS2_STRCMP(phase_name_l, phase_name))
         {
             return phase;
         }

Modified: webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c (original)
+++ webservices/axis2/trunk/c/modules/core/phaseresolver/phase_resolver.c Wed Jan 11 02:57:58
2006
@@ -12,6 +12,15 @@
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
  
 #include <axis2_phase_resolver.h>
@@ -431,7 +440,7 @@
                 { 
                     if(!all_handlers)
                     {
-                        all_handlers = axis2_array_list_create(env, 0);
+                        all_handlers = axis2_array_list_create(env, 20);
                         if(!all_handlers)
                             return AXIS2_FAILURE;
                     }
@@ -540,7 +549,7 @@
             {
                 if(!all_handlers)
                 {
-                    all_handlers = axis2_array_list_create(env, 0);
+                    all_handlers = axis2_array_list_create(env, 20);
                     if(!all_handlers)
                         return AXIS2_FAILURE;
                 }
@@ -701,7 +710,7 @@
         {
             struct axis2_phase_holder *phase_holder = NULL;
 
-            handlers = axis2_array_list_create(env, 0);
+            handlers = axis2_array_list_create(env, 20);
             for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
             {
                 struct axis2_handler_desc *metadata = NULL;
@@ -785,7 +794,7 @@
             {
                 return AXIS2_FAILURE;
             }
-            handlers = axis2_array_list_create(env, 0);
+            handlers = axis2_array_list_create(env, 20);
             int j = 0;
             for (j = 0; j < hndlr_count; j++) 
             {
@@ -1225,14 +1234,18 @@
     int type = 0;
     axis2_status_t status = AXIS2_FALSE;
     
+    AXIS2_FUNC_PARAM_CHECK(phase_resolver, env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, axis_op, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK((*env)->error, module_desc, AXIS2_FAILURE);
     resolver_impl = AXIS2_INTF_TO_IMPL(phase_resolver);
        
     for (type = 1; type < 5; type++) 
     {
-        struct axis2_flow *flow = NULL;
+        axis2_flow_t *flow = NULL;
         axis2_array_list_t *phases = NULL;
 
-        switch (type) {
+        switch (type) 
+        {
             case AXIS2_INFLOW:
             {
                 phases = AXIS2_OP_GET_REMAINING_PHASES_INFLOW(axis_op, env);
@@ -1244,20 +1257,23 @@
             }
             case AXIS2_OUTFLOW:
             {
-                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
-                    AXIS2_OP_GET_PHASES_OUTFLOW(axis_op, env));
+                phases = AXIS2_OP_GET_PHASES_OUTFLOW(axis_op, env);
+                resolver_impl->phase_holder = 
+                    axis2_phase_holder_create_with_phases(env, phases);
                 break;
             }
             case AXIS2_FAULT_INFLOW:
             {
-                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
-                    AXIS2_OP_GET_PHASES_IN_FAULT_FLOW(axis_op, env));
+                phases = AXIS2_OP_GET_PHASES_IN_FAULT_FLOW(axis_op, env);
+                resolver_impl->phase_holder = 
+                    axis2_phase_holder_create_with_phases(env, phases);
                 break;
             }
             case AXIS2_FAULT_OUTFLOW:
             {
-                resolver_impl->phase_holder = axis2_phase_holder_create_with_phases(env,
-                    AXIS2_OP_GET_PHASES_OUT_FAULT_FLOW(axis_op, env));
+                phases = AXIS2_OP_GET_PHASES_OUT_FAULT_FLOW(axis_op, env);
+                resolver_impl->phase_holder = 
+                    axis2_phase_holder_create_with_phases(env, phases);
                 break;
             }
         }
@@ -1291,30 +1307,33 @@
             
             for (j = 0; j < AXIS2_FLOW_GET_HANDLER_COUNT(flow, env); j++) 
             {
-                struct axis2_handler_desc *metadata = NULL;
+                axis2_handler_desc_t *metadata = NULL;
                 axis2_char_t *phase_name = NULL;
+                axis2_phase_rule_t *phase_rule = NULL;
 
                 metadata = AXIS2_FLOW_GET_HANDLER(flow, env, j);
-                phase_name = AXIS2_PHASE_RULE_GET_NAME(
-                        AXIS2_HANDLER_DESC_GET_RULES(metadata, env), env);
-             
+                phase_rule = AXIS2_HANDLER_DESC_GET_RULES(metadata, env);
+                phase_name = AXIS2_PHASE_RULE_GET_NAME(phase_rule, env);
+                printf("phase_name:%s\n", phase_name);
                 if ((0 != AXIS2_STRCMP(AXIS2_PHASE_TRANSPORTIN, phase_name)) &&
                     (0 != AXIS2_STRCMP(AXIS2_PHASE_DISPATCH, phase_name)) &&
                     (0 != AXIS2_STRCMP(AXIS2_PHASE_POST_DISPATCH, phase_name)) &&
                     (0 != AXIS2_STRCMP(AXIS2_PHASE_PRE_DISPATCH, phase_name)))
                 {
-                    status = AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->phase_holder,
-                        env, metadata);
+                    AXIS2_PHASE_HOLDER_ADD_HANDLER(resolver_impl->
+                        phase_holder, env, metadata);
            
-                } else 
+                } 
+                else 
                 {
                     AXIS2_ERROR_SET((*env)->error, 
-                        AXIS2_ERROR_SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE, AXIS2_FAILURE);
+                        AXIS2_ERROR_SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE, 
+                            AXIS2_FAILURE);
                     return AXIS2_FAILURE;
                     
                 }
             }
         }
     }
-    return status;
+    return AXIS2_SUCCESS;
 }

Modified: webservices/axis2/trunk/c/test/unit/core/description/test_op.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_op.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_op.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_op.c Wed Jan 11 02:57:58 2006
@@ -27,7 +27,7 @@
     struct axis2_phase *phase = NULL; 
     axis2_array_list_t *op_in_phases = NULL; 
     
-    op_in_phases = axis2_array_list_create(env, 0);
+    op_in_phases = axis2_array_list_create(env, 20);
     
     phase = axis2_phase_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
     AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);

Modified: webservices/axis2/trunk/c/test/unit/core/description/test_svc.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/description/test_svc.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/description/test_svc.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/description/test_svc.c Wed Jan 11 02:57:58 2006
@@ -41,13 +41,13 @@
     module_desc = axis2_module_desc_create(env);
     
     op_qname = axis2_qname_create(env, "op_name1", NULL, NULL);
-    op = axis2_op_create_with_name(env, op_qname);
+    op = axis2_op_create_with_qname(env, op_qname);
     op_in_phases = get_svc_op_in_phases(env);  
     AXIS2_OP_SET_REMAINING_PHASES_INFLOW(op, env, op_in_phases);
     AXIS2_MODULE_DESC_ADD_OP(module_desc, env, op);
     
     op_qname = axis2_qname_create(env, "op_name2", NULL, NULL);
-    op = axis2_op_create_with_name(env, op_qname);
+    op = axis2_op_create_with_qname(env, op_qname);
     op_in_phases = get_svc_op_in_phases(env);  
     AXIS2_OP_SET_REMAINING_PHASES_INFLOW(op, env, op_in_phases);
     AXIS2_MODULE_DESC_ADD_OP(module_desc, env, op);
@@ -105,7 +105,7 @@
     struct axis2_phase *phase = NULL; 
     axis2_array_list_t *op_in_phases = NULL; 
     
-    op_in_phases = axis2_array_list_create(env, 0);
+    op_in_phases = axis2_array_list_create(env, 20);
     
     phase = axis2_phase_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
     AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);

Modified: webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c?rev=368006&r1=368005&r2=368006&view=diff
==============================================================================
--- webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c (original)
+++ webservices/axis2/trunk/c/test/unit/core/phaseresolver/test_resolver.c Wed Jan 11 02:57:58
2006
@@ -18,7 +18,7 @@
     
     axis2_allocator_t *allocator = axis2_allocator_init (NULL);
     axis2_env_t *env = axis2_env_create (allocator);
-    struct axis2_op *optr = axis2_op_create(&env);
+    axis2_op_t *optr = axis2_op_create(&env);
     op_in_phases = get_op_in_phases(&env);  
     AXIS2_OP_SET_REMAINING_PHASES_INFLOW(optr, &env, op_in_phases);
     flow = axis2_flow_create(&env); 
@@ -30,6 +30,10 @@
         module_desc);
     
     CuAssertIntEquals(tc, expected, actual);
+    AXIS2_FLOW_FREE(flow, env);
+    /*AXIS2_OP_FREE(optr, env); */
+    /*AXIS2_MODULE_DESC_FREE(module_desc, env);*/
+    /*AXIS2_PHASE_RESOLVER_FREE(resolver, env); */
 }
 
 void add_handlers_to_flow(struct axis2_flow *flow, axis2_env_t **env)
@@ -81,7 +85,7 @@
     struct axis2_phase *phase = NULL; 
     axis2_array_list_t *op_in_phases = NULL; 
     
-    op_in_phases = axis2_array_list_create(env, 0);
+    op_in_phases = axis2_array_list_create(env, 10);
     
     phase = axis2_phase_create(env, AXIS2_PHASE_POLICY_DETERMINATION);
     AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
@@ -93,9 +97,6 @@
     AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
     
     phase = axis2_phase_create(env, AXIS2_PHASE_DISPATCH);  
-    AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
-    
-    phase = axis2_phase_create(env, AXIS2_PHASE_POLICY_DETERMINATION);   
     AXIS2_ARRAY_LIST_ADD(op_in_phases, env, phase);
     
     return op_in_phases;



Mime
View raw message