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/07/05 13:33:29 UTC

svn commit: r674180 - in /webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments: Makefile.am data_handler.c mime_body_part.c

Author: manjula
Date: Sat Jul  5 04:33:29 2008
New Revision: 674180

URL: http://svn.apache.org/viewvc?rev=674180&view=rev
Log:
Some comments and relevent names for the structs added.

Modified:
    webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/Makefile.am
    webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/data_handler.c
    webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/mime_body_part.c

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/Makefile.am
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/Makefile.am?rev=674180&r1=674179&r2=674180&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/Makefile.am (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/Makefile.am Sat Jul  5 04:33:29 2008
@@ -1,6 +1,6 @@
 noinst_LTLIBRARIES = libaxis2_attachments.la
 AM_CPPFLAGS = $(CPPFLAGS)
-libaxis2_attachments_la_SOURCES = mime_output.c \
+libaxis2_attachments_la_SOURCES = mime_part.c \
 					data_handler.c \
 					mime_body_part.c \
                     mime_parser.c

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=674180&r1=674179&r2=674180&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 Sat Jul  5 04:33:29 2008
@@ -22,14 +22,28 @@
 
 struct axiom_data_handler
 {
+    /* The content type */
     axis2_char_t *mime_type;
+    
+    /* If in a file then the file name*/
     axis2_char_t *file_name;
+
+    /* If it is in a buffer then the buffer */
     axis2_byte_t *buffer;
+
+    /* The length of the buffer */
     int buffer_len;
+
+    /* Is this a data_handler with a file name or a buffer*/
     axiom_data_handler_type_t data_handler_type;
+
+    /* When parsing whether we have cached it or not */
     axis2_bool_t cached;
 };
 
+
+/* Creates the data_handler. The file name is not mandatory */
+
 AXIS2_EXTERN axiom_data_handler_t *AXIS2_CALL
 axiom_data_handler_create(
     const axutil_env_t *env,
@@ -166,6 +180,11 @@
     return data_handler->buffer_len;
 }
 
+
+/* With MTOM caching support this function is no longer used
+ * Because this will load whole file in to buffer. So for large 
+ * attachment this is not wise */
+
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_data_handler_read_from(
     axiom_data_handler_t *data_handler,
@@ -336,6 +355,12 @@
     return AXIS2_SUCCESS;
 }
 
+/* This function will write the data in the buffer 
+ * to a file. When caching is being used this will 
+ * not be called , because the parser it self cache 
+ * the attachment while parsing */
+
+
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_data_handler_write_to(
     axiom_data_handler_t *data_handler,
@@ -395,7 +420,9 @@
 }
 
 /* This method will add the data_handler binary data to the array_list.
- * If it is a buffer the part type is buffer. otherwise it is a file
+ * If it is a buffer the part type is buffer. otherwise it is a file. In the
+ * case of file the array_list have just the file name and the size. The content
+ * is not loaded to the memory.
  */
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
@@ -405,7 +432,7 @@
     axutil_array_list_t *list)
     
 {
-    axiom_mime_output_part_t *binary_part = NULL;
+    axiom_mime_part_t *binary_part = NULL;
     
     binary_part = axiom_mime_output_part_create(env);
     
@@ -420,6 +447,9 @@
         binary_part->part_size = data_handler->buffer_len;
         binary_part->type = AXIOM_MIME_OUTPUT_PART_BUFFER;
     }
+
+    /* In the case of file we first calculate the file size
+     * and then add the file name */
     
     else if (data_handler->data_handler_type == AXIOM_DATA_HANDLER_TYPE_FILE
              && data_handler->file_name)
@@ -446,7 +476,9 @@
         /* Data Handler File Name is missing */
         return AXIS2_FAILURE;
     }
-    
+
+    /* Finaly we add the binary details to the list */    
+
     axutil_array_list_add(list, env, binary_part);
 
     return AXIS2_SUCCESS;

Modified: webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/mime_body_part.c
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/mime_body_part.c?rev=674180&r1=674179&r2=674180&view=diff
==============================================================================
--- webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/mime_body_part.c (original)
+++ webservices/axis2/branches/c/post_1_4_mtom/c/axiom/src/attachments/mime_body_part.c Sat Jul  5 04:33:29 2008
@@ -155,6 +155,9 @@
     return;
 }
 
+/* This method will add a mime_header to the hash */
+
+
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axiom_mime_body_part_add_header(
     axiom_mime_body_part_t *mime_body_part,
@@ -204,7 +207,7 @@
     axis2_char_t *temp_header_str = NULL;
     int header_str_size = 0;
     axis2_status_t status = AXIS2_FAILURE;
-    axiom_mime_output_part_t *mime_header_part = NULL;
+    axiom_mime_part_t *mime_header_part = NULL;
 
 
     /* We have the mime headers in the hash with thier keys