axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r926565 - in /axis/axis2/c/rampart/trunk/src: omxmlsec/axiom.c omxmlsec/tokens/token_binary_security_token.c omxmlsec/transforms_factory.c omxmlsec/xml_encryption.c util/rampart_encryption.c util/rampart_sec_header_builder.c
Date Tue, 23 Mar 2010 13:23:29 GMT
Author: shankar
Date: Tue Mar 23 13:23:28 2010
New Revision: 926565

URL: http://svn.apache.org/viewvc?rev=926565&view=rev
Log:
Refactor to increase performace

Modified:
    axis/axis2/c/rampart/trunk/src/omxmlsec/axiom.c
    axis/axis2/c/rampart/trunk/src/omxmlsec/tokens/token_binary_security_token.c
    axis/axis2/c/rampart/trunk/src/omxmlsec/transforms_factory.c
    axis/axis2/c/rampart/trunk/src/omxmlsec/xml_encryption.c
    axis/axis2/c/rampart/trunk/src/util/rampart_encryption.c
    axis/axis2/c/rampart/trunk/src/util/rampart_sec_header_builder.c

Modified: axis/axis2/c/rampart/trunk/src/omxmlsec/axiom.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/rampart/trunk/src/omxmlsec/axiom.c?rev=926565&r1=926564&r2=926565&view=diff
==============================================================================
--- axis/axis2/c/rampart/trunk/src/omxmlsec/axiom.c (original)
+++ axis/axis2/c/rampart/trunk/src/omxmlsec/axiom.c Tue Mar 23 13:23:28 2010
@@ -456,7 +456,7 @@ oxs_axiom_interchange_nodes(
     axis2_status_t status = AXIS2_FAILURE;
     axiom_node_t *temp_node = NULL;
 
-    temp_node = axiom_node_detach(node_to_move,env);
+    temp_node = axiom_node_detach_without_namespaces(node_to_move,env);
     status = axiom_node_insert_sibling_before(node_before, env, temp_node);
     return status;
 }

Modified: axis/axis2/c/rampart/trunk/src/omxmlsec/tokens/token_binary_security_token.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/rampart/trunk/src/omxmlsec/tokens/token_binary_security_token.c?rev=926565&r1=926564&r2=926565&view=diff
==============================================================================
--- axis/axis2/c/rampart/trunk/src/omxmlsec/tokens/token_binary_security_token.c (original)
+++ axis/axis2/c/rampart/trunk/src/omxmlsec/tokens/token_binary_security_token.c Tue Mar 23
13:23:28 2010
@@ -29,7 +29,7 @@ oxs_token_build_binary_security_token_el
     axis2_char_t* value_type,
     axis2_char_t* data)
 {
-    axiom_node_t *binary_security_token_node = NULL;
+    axiom_node_t *binary_sec_token_node = NULL;
     axiom_node_t *first_child_of_parent = NULL;
     axiom_element_t *binary_security_token_ele = NULL;
     axiom_attribute_t *encoding_type_att = NULL;
@@ -43,7 +43,7 @@ oxs_token_build_binary_security_token_el
     ns = axiom_namespace_create(env, RAMPART_WSU_XMLNS, OXS_WSU);
 
     binary_security_token_ele = axiom_element_create(env, parent, OXS_NODE_BINARY_SECURITY_TOKEN,
-        ns_obj, &binary_security_token_node);
+        ns_obj, &binary_sec_token_node);
     if(!binary_security_token_ele)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "[rampart]Error creating %s element.",
@@ -54,17 +54,17 @@ oxs_token_build_binary_security_token_el
     }
 
     /* Binary security token must be added as the first child of the paretn */
-    binary_security_token_node = axiom_node_detach(binary_security_token_node, env);
+    binary_sec_token_node = axiom_node_detach_without_namespaces(binary_sec_token_node, env);
     first_child_of_parent = axiom_node_get_first_element(parent, env);
     if(first_child_of_parent)
     {
         /* If there is a child add bst before it */
-        axiom_node_insert_sibling_before(first_child_of_parent, env, binary_security_token_node);
+        axiom_node_insert_sibling_before(first_child_of_parent, env, binary_sec_token_node);
     }
     else
     {
         /* If there are no children just add the bst */
-        axiom_node_add_child(parent, env, binary_security_token_node);
+        axiom_node_add_child(parent, env, binary_sec_token_node);
     }
 
     if(!id)
@@ -77,19 +77,19 @@ oxs_token_build_binary_security_token_el
     value_type_att = axiom_attribute_create(env, OXS_ATTR_VALUE_TYPE, value_type, NULL);
 
     ret = axiom_element_add_attribute(binary_security_token_ele, env, id_attr,
-        binary_security_token_node);
+        binary_sec_token_node);
     ret = axiom_element_add_attribute(binary_security_token_ele, env, encoding_type_att,
-        binary_security_token_node);
+        binary_sec_token_node);
     ret = axiom_element_add_attribute(binary_security_token_ele, env, value_type_att,
-        binary_security_token_node);
+        binary_sec_token_node);
 
     if(data)
     {
         ret = axiom_element_set_text(binary_security_token_ele, env, data,
-            binary_security_token_node);
+            binary_sec_token_node);
     }
 
-    return binary_security_token_node;
+    return binary_sec_token_node;
 }
 
 

Modified: axis/axis2/c/rampart/trunk/src/omxmlsec/transforms_factory.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/rampart/trunk/src/omxmlsec/transforms_factory.c?rev=926565&r1=926564&r2=926565&view=diff
==============================================================================
--- axis/axis2/c/rampart/trunk/src/omxmlsec/transforms_factory.c (original)
+++ axis/axis2/c/rampart/trunk/src/omxmlsec/transforms_factory.c Tue Mar 23 13:23:28 2010
@@ -72,7 +72,7 @@ oxs_transforms_enveloped_xmldsig(const a
 		node_local_name = axiom_util_get_localname(child_node, env);
 		if(!(axutil_strcmp(node_local_name, OXS_NODE_SIGNATURE)))
 		{	
-			sig_node = axiom_node_detach(child_node, env);
+			sig_node = axiom_node_detach(child_node, env); /* TODO should we use detach_without_namespace
here?? */
 			break;
 		}
 		child_node = axiom_node_get_next_sibling(child_node, env);

Modified: axis/axis2/c/rampart/trunk/src/omxmlsec/xml_encryption.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/rampart/trunk/src/omxmlsec/xml_encryption.c?rev=926565&r1=926564&r2=926565&view=diff
==============================================================================
--- axis/axis2/c/rampart/trunk/src/omxmlsec/xml_encryption.c (original)
+++ axis/axis2/c/rampart/trunk/src/omxmlsec/xml_encryption.c Tue Mar 23 13:23:28 2010
@@ -260,7 +260,6 @@ oxs_xml_enc_encrypt_node(
     /*Remove the node from the parent*/
     if(AXIS2_SUCCESS == ret)
     {
-        axiom_node_detach(node, env);
         axiom_node_free_tree(node, env);
         node = NULL;
     }
@@ -383,8 +382,6 @@ oxs_xml_enc_decrypt_node(
     parent_of_enc_node = axiom_node_get_parent(enc_type_node, env);
 
     axiom_node_insert_sibling_after(enc_type_node, env, deserialized_node);
-    axiom_node_detach(enc_type_node, env);
-
     axiom_node_free_tree(enc_type_node, env);
     enc_type_node = NULL;
 

Modified: axis/axis2/c/rampart/trunk/src/util/rampart_encryption.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/rampart/trunk/src/util/rampart_encryption.c?rev=926565&r1=926564&r2=926565&view=diff
==============================================================================
--- axis/axis2/c/rampart/trunk/src/util/rampart_encryption.c (original)
+++ axis/axis2/c/rampart/trunk/src/util/rampart_encryption.c Tue Mar 23 13:23:28 2010
@@ -720,7 +720,6 @@ rampart_enc_dk_encrypt_message(
             enc_data_node = oxs_axiom_get_node_by_id(env, envelope_node, OXS_ATTR_ID, id,
NULL);
             str_node = oxs_axiom_get_node_by_local_name(env, enc_data_node, OXS_NODE_SECURITY_TOKEN_REFRENCE);
             reference_node = oxs_axiom_get_node_by_local_name(env, str_node, OXS_NODE_REFERENCE);
-            reference_node = axiom_node_detach(reference_node, env);
             axiom_node_free_tree(reference_node, env);
             
             id_ref = axutil_stracat(env, OXS_LOCAL_REFERENCE_PREFIX,asym_key_id);
@@ -1333,7 +1332,7 @@ rampart_enc_encrypt_signature(
 
     if(node_to_move)
     {
-        temp_node = axiom_node_detach(node_to_move, env);
+        temp_node = axiom_node_detach_without_namespaces(node_to_move, env);
         if(temp_node)
         {
             enc_status = axiom_node_insert_sibling_after(

Modified: axis/axis2/c/rampart/trunk/src/util/rampart_sec_header_builder.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/rampart/trunk/src/util/rampart_sec_header_builder.c?rev=926565&r1=926564&r2=926565&view=diff
==============================================================================
--- axis/axis2/c/rampart/trunk/src/util/rampart_sec_header_builder.c (original)
+++ axis/axis2/c/rampart/trunk/src/util/rampart_sec_header_builder.c Tue Mar 23 13:23:28 2010
@@ -371,7 +371,7 @@ rampart_shb_ensure_sec_header_order(cons
         {
             axiom_node_t *tmp_node = NULL;
             tmp_node = (axiom_node_t*)axutil_array_list_get(enc_key_list, env, i);
-            enc_key_node = axiom_node_detach(tmp_node, env);
+            enc_key_node = axiom_node_detach_without_namespaces(tmp_node, env);
             axiom_node_insert_sibling_before(first_protection_item, env, enc_key_node);
         }
     }



Mime
View raw message