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 ma...@apache.org on 2008/05/22 16:17:25 UTC

svn commit: r659114 - in /webservices/axis2/branches/c/post_1_4_mtom/c: ./ axiom/include/ axiom/src/attachments/ guththila/src/ include/ src/core/transport/http/server/apache2/ util/include/ util/src/

Author: manjula
Date: Thu May 22 07:17:23 2008
New Revision: 659114

URL: http://svn.apache.org/viewvc?rev=659114&view=rev
Log:
merging changes from the trunk.

Modified:
    webservices/axis2/branches/c/post_1_4_mtom/c/   (props changed)
    webservices/axis2/branches/c/post_1_4_mtom/c/axiom/include/axiom_data_handler.h
    webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/data_handler.c
    webservices/axis2/branches/c/post_1_4_mtom/c/guththila/src/guththila_xml_writer.c
    webservices/axis2/branches/c/post_1_4_mtom/c/include/axis2_msg_ctx.h
    webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c
    webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/mod_axis2.c
    webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_allocator.h
    webservices/axis2/branches/c/post_1_4_mtom/c/util/src/allocator.c

Propchange: webservices/axis2/branches/c/post_1_4_mtom/c/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 22 07:17:23 2008
@@ -1 +1 @@
-/webservices/axis2/trunk/c:1-656962
+/webservices/axis2/trunk/c:1-659112

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/axiom/include/axiom_data_handler.h
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/axiom/include/axiom_data_handler.h?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/axiom/include/axiom_data_handler.h (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/axiom/include/axiom_data_handler.h Thu May 22 07:17:23 2008
@@ -59,6 +59,18 @@
     axiom_data_handler_get_content_type(
         axiom_data_handler_t * data_handler,
         const axutil_env_t * env);
+	
+    /**
+     * @param data_handler, a pointer to data handler struct
+     * @param env environment, MUST NOT be NULL.
+	 * @param mime type, 
+     * @return status code, AXIS2_SUCCESS on success and AXIS2_FAILURE on error.
+     */
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axiom_data_handler_set_content_type(
+        axiom_data_handler_t * data_handler,
+        const axutil_env_t * env,
+		const axis2_char_t *mime_type);
 
     /**
      * @param data_handler, a pointer to data handler struct

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/data_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/data_handler.c?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/data_handler.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/data_handler.c Thu May 22 07:17:23 2008
@@ -114,6 +114,20 @@
     return data_handler->mime_type;
 }
 
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axiom_data_handler_set_content_type(
+    axiom_data_handler_t *data_handler,
+    const axutil_env_t *env,
+	const axis2_char_t *mime_type)
+{
+	if(data_handler->mime_type)
+	{
+		AXIS2_FREE(env->allocator, data_handler->mime_type);
+	}
+	data_handler->mime_type = axutil_strdup(env, mime_type);
+    return AXIS2_SUCCESS;
+}
+
 AXIS2_EXTERN axis2_byte_t *AXIS2_CALL
 axiom_data_handler_get_input_stream(
     axiom_data_handler_t *data_handler,

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/guththila/src/guththila_xml_writer.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/guththila/src/guththila_xml_writer.c?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/guththila/src/guththila_xml_writer.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/guththila/src/guththila_xml_writer.c Thu May 22 07:17:23 2008
@@ -135,6 +135,13 @@
     size_t buff_len,
     const axutil_env_t * env);
 
+/*
+ * Private function for free the contents of a empty element.
+ */
+int GUTHTHILA_CALL guththila_free_empty_element(
+        guththila_xml_writer_t *wr,
+        const axutil_env_t *env);
+
 GUTHTHILA_EXPORT guththila_xml_writer_t * GUTHTHILA_CALL 
 guththila_create_xml_stream_writer(guththila_char_t *file_name,
                                    const axutil_env_t * env) 
@@ -477,6 +484,34 @@
     return GUTHTHILA_FAILURE;
 }
 
+int GUTHTHILA_CALL 
+guththila_free_empty_element(
+        guththila_xml_writer_t *wr,
+        const axutil_env_t *env)
+{
+    guththila_xml_writer_element_t * elem = NULL;
+    guththila_xml_writer_namesp_t * namesp = NULL;
+    int i = 0, j = 0;
+    elem =
+        (guththila_xml_writer_element_t *) guththila_stack_pop(&wr->element, env);
+    if (elem)
+    {
+        wr->status = BEGINING;
+        if (elem->name_sp_stack_no != -1)
+        {
+            GUTHTHILA_WRITER_CLEAR_NAMESP(wr, &wr->namesp,
+                                           elem->name_sp_stack_no, i,
+                                           namesp, j, env);
+        }
+        GUTHTHILA_WRITER_ELEM_FREE(wr, elem, env);
+        return GUTHTHILA_SUCCESS;
+    }
+    else
+    {
+        return GUTHTHILA_FAILURE;
+    }    
+}
+
 GUTHTHILA_EXPORT int GUTHTHILA_CALL 
 guththila_write_start_document(guththila_xml_writer_t * wr,
                                const axutil_env_t * env,
@@ -538,6 +573,7 @@
     else if (wr->status == START_EMPTY)
     {
         /* We need to close and start */
+        guththila_free_empty_element(wr, env);
         guththila_write(wr, "/><", 3u, env);
         cur_pos = wr->next;
         guththila_write_xtoken(wr, start_element, len, env);
@@ -701,6 +737,7 @@
     }
     else if (wr->status == START_EMPTY)
     {
+        guththila_free_empty_element(wr, env);
         wr->status = BEGINING;
         guththila_write(wr, "/>", 2u, env);
     }
@@ -750,7 +787,8 @@
         return GUTHTHILA_SUCCESS;
     }
     else if (wr->status == START_EMPTY)
-    {
+    { 
+        guththila_free_empty_element(wr, env);
         wr->status = BEGINING;
         guththila_write(wr, "/><!--", 6u, env);
         guththila_write(wr, buff, strlen(buff), env);
@@ -818,6 +856,8 @@
     }
     else if (wr->status == START_EMPTY)
     {
+        guththila_free_empty_element(wr, env);
+        wr->status = BEGINING;
         guththila_write(wr, "/><", 3u, env);
         cur_pos = wr->next;
         guththila_write_xtoken(wr, start_element, len, env);
@@ -1260,6 +1300,7 @@
         }
         else if (wr->status == START_EMPTY)
         {
+            guththila_free_empty_element(wr, env);
             guththila_write(wr, "/><", 2u, env);
             elem_pref_start = wr->next;
             guththila_write_xtoken(wr, prefix, pref_len, env);
@@ -1420,6 +1461,7 @@
     }
     else if (wr->status == START_EMPTY)
     {
+        guththila_free_empty_element(wr, env);
         guththila_write(wr, "/><", 2u, env);       
     }
     else if (wr->status == BEGINING)
@@ -1529,6 +1571,7 @@
                 }
                 else if (wr->status == START_EMPTY)
                 {
+                    guththila_free_empty_element(wr, env);
                     guththila_write(wr, "/><", 3u, env);
                     guththila_write_xtoken(wr, prefix, pref_len, env);
                     guththila_write(wr, ":", 1u, env);
@@ -1652,6 +1695,7 @@
         }
         else if (wr->status == START_EMPTY)
         {
+            guththila_free_empty_element(wr, env);
             guththila_write(wr, "/><", 2u, env);
             elem_pref_start = wr->next;
             guththila_write_xtoken(wr, prefix, pref_len, env);
@@ -1801,7 +1845,8 @@
         guththila_write(wr, "><", 2u, env);       
     }
     else if (wr->status == START_EMPTY)
-    {
+    {   
+        guththila_free_empty_element(wr, env);
         guththila_write(wr, "/><", 2u, env);       
     }
     else if (wr->status == BEGINING)
@@ -1911,6 +1956,7 @@
                 }
                 else if (wr->status == START_EMPTY)
                 {
+                    guththila_free_empty_element(wr, env);
                     guththila_write(wr, "/><", 3u, env);
                     guththila_write_xtoken(wr, prefix, pref_len, env);
                     guththila_write(wr, ":", 1u, env);

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/include/axis2_msg_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/include/axis2_msg_ctx.h?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/include/axis2_msg_ctx.h (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/include/axis2_msg_ctx.h Thu May 22 07:17:23 2008
@@ -804,7 +804,7 @@
      * @return HTTP Method string, returns a reference,
      * not a cloned copy
      */
-    const axis2_char_t *AXIS2_CALL
+    AXIS2_EXTERN const axis2_char_t *AXIS2_CALL
     axis2_msg_ctx_get_rest_http_method(
         const axis2_msg_ctx_t * msg_ctx,
         const axutil_env_t * env);
@@ -818,7 +818,7 @@
      * ownership of rest_http_method.
      * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-    axis2_status_t AXIS2_CALL
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
     axis2_msg_ctx_set_rest_http_method(
         struct axis2_msg_ctx * msg_ctx,
         const axutil_env_t * env,
@@ -1456,7 +1456,7 @@
      * arrary list will be freed by the msg_ctx
      * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
      */
-    axis2_status_t AXIS2_CALL
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
     axis2_msg_ctx_set_supported_rest_http_methods(
         axis2_msg_ctx_t * msg_ctx,
         const axutil_env_t * env,

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/apache2_worker.c Thu May 22 07:17:23 2008
@@ -158,7 +158,6 @@
     axis2_char_t *soap_action_header_txt = NULL;
     axis2_bool_t processed = AXIS2_FALSE;
     int content_length = -1;
-    axis2_char_t *encoding_header_value = NULL;
     axis2_char_t *url_external_form = NULL;
     axis2_char_t *body_string = NULL;
     unsigned int body_string_len = 0;
@@ -230,8 +229,6 @@
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Client HTTP version %s",
                     http_version);
 
-    encoding_header_value = (axis2_char_t *) request->content_encoding;
-
     out_desc = axis2_conf_get_transport_out(axis2_conf_ctx_get_conf
                                             (apache2_worker->conf_ctx, env),
                                             env, AXIS2_TRANSPORT_ENUM_HTTP);

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/mod_axis2.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/mod_axis2.c?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/mod_axis2.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/src/core/transport/http/server/apache2/mod_axis2.c Thu May 22 07:17:23 2008
@@ -101,6 +101,10 @@
     axutil_allocator_t * allocator,
     void *ptr);
 
+void AXIS2_CALL
+axis2_module_pool_allocator_destroy(
+    axutil_allocator_t *allocator);
+
 static void axis2_module_init(
     apr_pool_t * p,
     server_rec * svr_rec);
@@ -351,6 +355,9 @@
     allocator->local_pool = (void *) local_pool;
     allocator->current_pool = (void *) local_pool;
     allocator->global_pool = axutil_env->allocator->global_pool;
+    allocator->pool_allocator_destroy = axis2_module_pool_allocator_destroy;
+    allocator->pool_allocator = local_allocator;
+    allocator->ref_pool_allocator = 1; 
 
     error = axutil_error_create(allocator);
     thread_env = axutil_env_create_with_error_log_thread_pool(allocator,
@@ -365,8 +372,10 @@
         return HTTP_INTERNAL_SERVER_ERROR;
     }
 
-    apr_pool_destroy(local_pool);
-    apr_allocator_destroy(local_allocator);
+    axis2_module_pool_allocator_destroy(allocator);    
+
+    /*apr_pool_destroy(local_pool);
+    apr_allocator_destroy(local_allocator);*/
 
     return rv;
 }
@@ -433,6 +442,18 @@
 #endif
 }
 
+void AXIS2_CALL 
+axis2_module_pool_allocator_destroy(
+    axutil_allocator_t *allocator)
+{
+    if((--(allocator->ref_pool_allocator)) == 0)
+    {
+        apr_pool_destroy(allocator->local_pool);
+        apr_allocator_destroy(allocator->pool_allocator);
+    }
+}
+
+
 static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog,
 								 apr_pool_t *ptemp, server_rec *svr_rec)
 {

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_allocator.h
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_allocator.h?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_allocator.h (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/util/include/axutil_allocator.h Thu May 22 07:17:23 2008
@@ -107,6 +107,15 @@
          * set the current pool to global pool or to local pool respectively. 
          */
         void *current_pool;
+
+        void *pool_allocator;
+        int ref_pool_allocator;
+
+        void(
+            AXIS2_CALL
+            * pool_allocator_destroy)(
+                struct axutil_allocator * allocator);
+
     }
     axutil_allocator_t;
 
@@ -167,6 +176,10 @@
 #define AXIS2_FREE(allocator, ptr) \
       ((allocator)->free_fn(allocator, ptr))
 
+#define AXIS2_POOL_ALLOCATOR_DESTROY(allocator) \
+      ((allocator)->pool_allocator_destroy(allocator))  
+
+
     /** @} */
 
 #ifdef __cplusplus

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/util/src/allocator.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/util/src/allocator.c?rev=659114&r1=659113&r2=659114&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/util/src/allocator.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/util/src/allocator.c Thu May 22 07:17:23 2008
@@ -49,6 +49,10 @@
             allocator->malloc_fn = axutil_allocator_malloc_impl;
             allocator->realloc = axutil_allocator_realloc_impl;
             allocator->free_fn = axutil_allocator_free_impl;
+            allocator->pool_allocator_destroy = NULL;
+            allocator->pool_allocator = NULL;
+            allocator->ref_pool_allocator = 0;
+
             return allocator;
         }
     }