You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2007/01/11 10:32:38 UTC

svn commit: r495165 - in /webservices/axis2/trunk/c: axiom/src/om/om_document.c axiom/src/om/om_output.c axiom/src/om/om_text.c modules/core/context/msg_ctx.c

Author: samisa
Date: Thu Jan 11 01:32:29 2007
New Revision: 495165

URL: http://svn.apache.org/viewvc?view=rev&rev=495165
Log:
Removed some unwanted stringdups

Modified:
    webservices/axis2/trunk/c/axiom/src/om/om_document.c
    webservices/axis2/trunk/c/axiom/src/om/om_output.c
    webservices/axis2/trunk/c/axiom/src/om/om_text.c
    webservices/axis2/trunk/c/modules/core/context/msg_ctx.c

Modified: webservices/axis2/trunk/c/axiom/src/om/om_document.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_document.c?view=diff&rev=495165&r1=495164&r2=495165
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_document.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_document.c Thu Jan 11 01:32:29 2007
@@ -74,29 +74,11 @@
     document->root_element = root;
     document->first_child = root;
     document->last_child = root;
-    document->xml_version = NULL;
-    document->char_set_encoding = NULL;
+    document->xml_version = XML_VERSION;
+    document->char_set_encoding = CHAR_SET_ENCODING;
     document->done = AXIS2_FALSE;
     document->om_document.ops = &axiom_document_ops_var;
 
-    document->char_set_encoding = (axis2_char_t *) AXIS2_STRDUP(CHAR_SET_ENCODING, env);
-    if (!document->char_set_encoding)
-    {
-        AXIS2_FREE(env->allocator, document);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
-    document->xml_version = (axis2_char_t *) AXIS2_STRDUP(XML_VERSION, env);
-    if (!document->xml_version)
-    {
-
-        AXIS2_FREE(env->allocator, document->char_set_encoding);
-        AXIS2_FREE(env->allocator, document);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
     return &(document->om_document);
 }
 
@@ -109,16 +91,6 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     document = AXIS2_INTF_TO_IMPL(om_document);
 
-    if (document->char_set_encoding)
-    {
-        AXIS2_FREE(env->allocator, document->char_set_encoding);
-        document->char_set_encoding = NULL;
-    }
-    if (document->xml_version)
-    {
-        AXIS2_FREE(env->allocator, document->xml_version);
-        document->xml_version = NULL;
-    }
     if (document->root_element)
     {
 

Modified: webservices/axis2/trunk/c/axiom/src/om/om_output.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_output.c?view=diff&rev=495165&r1=495164&r2=495165
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_output.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_output.c Thu Jan 11 01:32:29 2007
@@ -104,7 +104,7 @@
     om_output_impl->next_content_id = NULL;
     om_output_impl->next_id = 0;
     om_output_impl->is_soap11 = AXIS2_TRUE;
-    om_output_impl->char_set_encoding = NULL;
+    om_output_impl->char_set_encoding = AXIS2_DEFAULT_CHAR_SET_ENCODING;
     om_output_impl->xml_version = NULL;
     om_output_impl->ignore_xml_declaration = AXIS2_TRUE;
     om_output_impl->binary_node_list = NULL;
@@ -112,16 +112,6 @@
     om_output_impl->mime_boundry = NULL;
     om_output_impl->om_output.ops = &axiom_output_ops_var;
 
-    om_output_impl->char_set_encoding = AXIS2_STRDUP(
-                AXIS2_DEFAULT_CHAR_SET_ENCODING, env);
-
-    if (!(om_output_impl->char_set_encoding))
-    {
-        AXIS2_FREE(env->allocator, om_output_impl);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
     return &(om_output_impl->om_output);
 }
 
@@ -139,11 +129,6 @@
         AXIS2_FREE(env->allocator, om_output_impl->xml_version);
         om_output_impl->xml_version = NULL;
     }
-    if (om_output_impl->char_set_encoding)
-    {
-        AXIS2_FREE(env->allocator, om_output_impl->char_set_encoding);
-        om_output_impl->char_set_encoding = NULL;
-    }
     if (om_output_impl->mime_boundary)
     {
         AXIS2_FREE(env->allocator, om_output_impl->mime_boundary);
@@ -262,20 +247,10 @@
 {
     axiom_output_impl_t *output_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_PARAM_CHECK(env->error, char_set_encoding, AXIS2_FAILURE);
     output_impl = AXIS2_INTF_TO_IMPL(om_output);
 
-    if (output_impl->char_set_encoding)
-    {
-        AXIS2_FREE(env->allocator, output_impl->char_set_encoding);
-        output_impl->char_set_encoding = NULL;
-    }
+    output_impl->char_set_encoding = char_set_encoding;
 
-    output_impl->char_set_encoding = AXIS2_STRDUP(char_set_encoding, env);
-    if (!output_impl->char_set_encoding)
-    {
-        return AXIS2_FAILURE;
-    }
     return AXIS2_SUCCESS;
 }
 

Modified: webservices/axis2/trunk/c/axiom/src/om/om_text.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/om/om_text.c?view=diff&rev=495165&r1=495164&r2=495165
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_text.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_text.c Thu Jan 11 01:32:29 2007
@@ -196,7 +196,6 @@
     int status = AXIS2_SUCCESS;
     axiom_text_impl_t *om_text_impl = NULL;
     axis2_char_t *attribute_value = NULL;
-    axis2_char_t *temp_attribute_value = NULL;
     axis2_char_t *text = NULL;
     axiom_xml_writer_t *om_output_xml_writer = NULL;
 
@@ -222,10 +221,8 @@
                 if (content_id)
                     om_text_impl->content_id = AXIS2_STRDUP(content_id, env);
             }
-            attribute_value = AXIS2_STRDUP("cid:", env);
-            temp_attribute_value = AXIS2_STRACAT(attribute_value, om_text_impl->content_id, env);
-            AXIS2_FREE(env->allocator, attribute_value);
-            attribute_value = temp_attribute_value;
+
+            attribute_value = AXIS2_STRACAT("cid:", om_text_impl->content_id, env);
 
             /*send binary as MTOM optimised*/
             if (om_text_impl->om_attribute)

Modified: webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/msg_ctx.c?view=diff&rev=495165&r1=495164&r2=495165
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/msg_ctx.c Thu Jan 11 01:32:29 2007
@@ -307,12 +307,6 @@
         msg_ctx->svc_ctx_id = NULL;
     }
 
-    /*if (msg_ctx->paused_phase_name)
-    {
-        AXIS2_FREE(env->allocator, msg_ctx->paused_phase_name);
-        msg_ctx->paused_phase_name = NULL;
-    }*/
-
     if (msg_ctx->soap_action)
     {
         AXIS2_FREE(env->allocator, msg_ctx->soap_action);
@@ -1373,21 +1367,6 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    /*if (msg_ctx->paused_phase_name)
-    {
-        AXIS2_FREE(env->allocator, msg_ctx->paused_phase_name);
-        msg_ctx->paused_phase_name = NULL;
-    }
-
-    if (paused_phase_name)
-    {
-        msg_ctx->paused_phase_name = AXIS2_STRDUP(paused_phase_name, env);
-        if (!(msg_ctx->paused_phase_name))
-        {
-            AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-            return AXIS2_FAILURE;
-        }
-    }*/
     /* a shallow copy is sufficient as phase lives beyond message */
     msg_ctx->paused_phase_name = (axis2_char_t *)paused_phase_name; 
     return AXIS2_SUCCESS;



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