axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From din...@apache.org
Subject svn commit: r597573 - in /webservices/axis2/trunk/c: guththila/src/guththila_xml_writer.c src/core/clientapi/op_client.c src/core/clientapi/stub.c src/core/clientapi/svc_client.c src/core/deployment/dep_engine.c src/core/engine/conf.c
Date Fri, 23 Nov 2007 06:38:01 GMT
Author: dinesh
Date: Thu Nov 22 22:37:57 2007
New Revision: 597573

URL: http://svn.apache.org/viewvc?rev=597573&view=rev
Log:
add param checks

Modified:
    webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c
    webservices/axis2/trunk/c/src/core/clientapi/op_client.c
    webservices/axis2/trunk/c/src/core/clientapi/stub.c
    webservices/axis2/trunk/c/src/core/clientapi/svc_client.c
    webservices/axis2/trunk/c/src/core/deployment/dep_engine.c
    webservices/axis2/trunk/c/src/core/engine/conf.c

Modified: webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c?rev=597573&r1=597572&r2=597573&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_xml_writer.c Thu Nov 22 22:37:57 2007
@@ -274,7 +274,8 @@
                 temp = temp * 2;
             }
             wr->buffer.buff[wr->buffer.cur_buff] =
-                (guththila_char_t *) AXIS2_MALLOC(env->allocator, sizeof(guththila_char_t)
* temp);
+                (guththila_char_t *) AXIS2_MALLOC(env->allocator, 
+                                                  sizeof(guththila_char_t) * temp); 
             wr->buffer.buffs_size[wr->buffer.cur_buff] = temp;
             memcpy(wr->buffer.buff[wr->buffer.cur_buff], buff + remain_len,
                     buff_len - remain_len);

Modified: webservices/axis2/trunk/c/src/core/clientapi/op_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/op_client.c?rev=597573&r1=597572&r2=597573&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/op_client.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/op_client.c Thu Nov 22 22:37:57 2007
@@ -188,12 +188,22 @@
         *in_msg_ctx = NULL;
     axis2_msg_ctx_t **msg_ctx_map = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, op_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, mc, AXIS2_FAILURE);
 
     msg_ctx_map = axis2_op_ctx_get_msg_ctx_map(op_client->op_ctx, env);
 
-    out_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_OUT];
-    in_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN];
+    if (msg_ctx_map)
+    {
+        out_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_OUT];
+        in_msg_ctx = msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN];
+    }
+    else
+    {
+        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+                         "msg_ctx_map is NULL, unable to continue");
+        return AXIS2_FAILURE;
+    }
 
     if (op_client->reuse)
     {
@@ -205,12 +215,14 @@
             out_msg_ctx = NULL;
             msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_OUT] = NULL;
         }
+
         if (in_msg_ctx)
         {
             axis2_msg_ctx_free(in_msg_ctx, env);
             in_msg_ctx = NULL;
             msg_ctx_map[AXIS2_WSDL_MESSAGE_LABEL_IN] = NULL;
         }
+
         axis2_op_ctx_set_complete(op_client->op_ctx, env, AXIS2_FALSE);
         op_client->reuse = AXIS2_FALSE;
     }

Modified: webservices/axis2/trunk/c/src/core/clientapi/stub.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/stub.c?rev=597573&r1=597572&r2=597573&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/stub.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/stub.c Thu Nov 22 22:37:57 2007
@@ -57,6 +57,7 @@
     AXIS2_PARAM_CHECK(env->error, endpoint_ref, NULL);
 
     stub = (axis2_stub_t *) axis2_stub_create(env);
+
     if (!stub)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);

Modified: webservices/axis2/trunk/c/src/core/clientapi/svc_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/svc_client.c?rev=597573&r1=597572&r2=597573&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/svc_client.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/svc_client.c Thu Nov 22 22:37:57 2007
@@ -338,6 +338,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return svc_client->svc;
 }
 
@@ -347,8 +348,7 @@
     const axutil_env_t * env,
     const axis2_options_t * options)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     if (svc_client->options)
     {
         axis2_options_free(svc_client->options, env);
@@ -362,6 +362,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return svc_client->options;
 }
 
@@ -371,7 +372,7 @@
     const axutil_env_t * env,
     const axis2_options_t * override_options)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
 
     if (svc_client->override_options)
     {
@@ -388,6 +389,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return svc_client->override_options;
 }
 
@@ -400,7 +402,7 @@
     axis2_module_desc_t *module = NULL;
     axutil_qname_t *mod_qname = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FAILURE);
 
     mod_qname = axutil_qname_create(env, module_name, NULL, NULL);
@@ -434,7 +436,7 @@
     axis2_module_desc_t *module = NULL;
     axutil_qname_t *mod_qname = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, module_name, AXIS2_FAILURE);
 
     mod_qname = axutil_qname_create(env, module_name, NULL, NULL);
@@ -463,8 +465,8 @@
     const axutil_env_t * env,
     axiom_node_t * header)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     if (!svc_client->headers)
     {
         svc_client->headers = axutil_array_list_create(env, 0);
@@ -486,7 +488,7 @@
 {
     int i = 0,
         size = 0;
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
 
     if (!svc_client->headers)
     {
@@ -521,7 +523,7 @@
     axis2_status_t status = AXIS2_FAILURE;
     axis2_bool_t qname_free_flag = AXIS2_FALSE;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
 
     if (!op_qname)
     {
@@ -561,6 +563,8 @@
     const axutil_env_t * env,
     const axiom_node_t * payload)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, payload, AXIS2_FAILURE);
     return axis2_svc_client_send_robust_with_op_qname(svc_client, env, NULL,
                                                       payload);
 }
@@ -575,6 +579,11 @@
     axis2_msg_ctx_t *msg_ctx = NULL;
     axis2_bool_t qname_free_flag = AXIS2_FALSE;
 
+    if (!svc_client)
+    {
+        return;
+    }
+
     if (!env)
     {
         return;
@@ -617,6 +626,10 @@
     const axutil_env_t * env,
     const axiom_node_t * payload)
 {
+    if (!svc_client)
+    {
+        return;
+    }
     axis2_svc_client_fire_and_forget_with_op_qname(svc_client, env, NULL,
                                                    payload);
 }
@@ -642,7 +655,7 @@
 
 
 
-    AXIS2_ENV_CHECK(env, NULL);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
 
     svc_client->last_response_soap_envelope = NULL;
     svc_client->last_response_has_fault = AXIS2_FALSE;
@@ -877,6 +890,7 @@
     const axutil_env_t * env,
     const axiom_node_t * payload)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return axis2_svc_client_send_receive_with_op_qname(svc_client, env, NULL,
                                                        payload);
 }
@@ -892,6 +906,11 @@
     axis2_msg_ctx_t *msg_ctx = NULL;
     AXIS2_TRANSPORT_ENUMS transport_in_protocol;
     axis2_bool_t qname_free_flag = AXIS2_FALSE;
+    
+    if (!svc_client)
+    {
+        return;
+    }
 
     if (!op_qname)
     {
@@ -955,6 +974,11 @@
     const axiom_node_t * payload,
     axis2_callback_t * callback)
 {
+    if (!svc_client)
+    {
+        return;
+    }
+
     axis2_svc_client_send_receive_non_blocking_with_op_qname(svc_client, env,
                                                              NULL, payload,
                                                              callback);
@@ -968,7 +992,7 @@
 {
     axis2_op_t *op = NULL;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
 
     op = axis2_svc_get_op_with_qname(svc_client->svc, env, op_qname);
 
@@ -1011,7 +1035,7 @@
 {
     AXIS2_TRANSPORT_ENUMS transport_in_protocol;
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
 
     transport_in_protocol =
         axis2_options_get_transport_in_protocol(svc_client->options, env);
@@ -1031,8 +1055,6 @@
     const axutil_env_t * env,
     const axis2_char_t * transport)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     return NULL;
 }
 
@@ -1041,8 +1063,6 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     return NULL;
 }
 
@@ -1052,8 +1072,6 @@
     const axutil_env_t * env,
     axis2_endpoint_ref_t * target_endpoint_ref)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     return AXIS2_FAILURE;
 }
 
@@ -1062,8 +1080,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return svc_client->svc_ctx;
 }
 
@@ -1075,8 +1092,7 @@
     const axis2_char_t * client_home)
 {
 
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     svc_client->conf_ctx = conf_ctx;
     if (!(svc_client->conf_ctx))
     {
@@ -1105,6 +1121,9 @@
     const axutil_env_t * env,
     axis2_svc_client_t * svc_client)
 {
+
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
+
     svc_client->svc = NULL;
 
     svc_client->conf_ctx = NULL;
@@ -1156,7 +1175,7 @@
     *op_out_only,
     *op_robust_out_only;
     axis2_phases_info_t *info = NULL;
-
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     tmp_qname = axutil_qname_create(env, AXIS2_ANON_SERVICE, NULL, NULL);
 
     if (!tmp_qname)
@@ -1246,6 +1265,11 @@
     const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, void);
+    
+    if (!svc_client)
+    {
+        return;
+    }
 
     if (svc_client->svc)
     {
@@ -1292,6 +1316,7 @@
     const axis2_char_t *soap_version_uri;
     int soap_version;
     axiom_soap_envelope_t *envelope = NULL;
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
 
     soap_version_uri =
         axis2_options_get_soap_version_uri(svc_client->options, env);
@@ -1371,6 +1396,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return svc_client->op_client;
 }
 
@@ -1379,6 +1405,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return svc_client->last_response_soap_envelope;
 }
 
@@ -1387,6 +1414,7 @@
     const axis2_svc_client_t * svc_client,
     const axutil_env_t * env)
 {
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     return svc_client->last_response_has_fault;
 }
 
@@ -1408,6 +1436,7 @@
     axiom_attribute_t *host_attr = NULL;
     axiom_attribute_t *port_attr = NULL;
 
+    AXIS2_PARAM_CHECK(env->error, svc_client, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, proxy_host, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, proxy_port, AXIS2_FAILURE);
 
@@ -1455,6 +1484,7 @@
     axiom_node_t * root_node)
 {
 
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     neethi_policy_t *neethi_policy = NULL;
 
     neethi_policy = neethi_util_create_policy_from_om(env, root_node);
@@ -1480,6 +1510,7 @@
     axis2_desc_t *desc = NULL;
     axis2_policy_include_t *policy_include = NULL;
 
+    AXIS2_PARAM_CHECK (env->error, svc_client, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, policy, AXIS2_FAILURE);
 
     svc = axis2_svc_client_get_svc(svc_client, env);

Modified: webservices/axis2/trunk/c/src/core/deployment/dep_engine.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/deployment/dep_engine.c?rev=597573&r1=597572&r2=597573&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/deployment/dep_engine.c (original)
+++ webservices/axis2/trunk/c/src/core/deployment/dep_engine.c Thu Nov 22 22:37:57 2007
@@ -838,7 +838,7 @@
             else
             {
                 AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
-                                 "axis2.xml  is not available in client repo %s ", client_home);
+                                 "axis2.xml is not available in client repo %s ", client_home);
                 AXIS2_ERROR_SET (env->error, AXIS2_ERROR_CONFIG_NOT_FOUND, AXIS2_FAILURE);
                 return NULL;
             }

Modified: webservices/axis2/trunk/c/src/core/engine/conf.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/conf.c?rev=597573&r1=597572&r2=597573&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/conf.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/conf.c Thu Nov 22 22:37:57 2007
@@ -1434,8 +1434,18 @@
 			 */
 			axis2_xml = (axis2_char_t *)axis2_conf_get_axis2_xml (conf, env);
 			module_dir_param = axis2_conf_get_param (conf, env, "moduleDir");
-			module_dir = (axis2_char_t *) 
+
+            if (module_dir_param)
+            {
+                module_dir = (axis2_char_t *) 
 					axutil_param_get_value (module_dir_param, env);
+            }
+            else
+            {
+                AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
+                                 "moduleDir parameter not available in axis2.xml.");
+                return AXIS2_FAILURE;
+            }
 			temp_path1 = axutil_strcat (env, 
                                         module_dir, 
                                         AXIS2_PATH_SEP_STR, NULL);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message