You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by na...@apache.org on 2006/10/17 07:45:59 UTC

svn commit: r464819 - in /webservices/axis2/trunk/c/axiom: include/axiom_data_handler.h src/attachments/data_handler.c src/attachments/mime_parser.c

Author: nandika
Date: Mon Oct 16 22:45:58 2006
New Revision: 464819

URL: http://svn.apache.org/viewvc?view=rev&rev=464819
Log:
compile errors fixed

Modified:
    webservices/axis2/trunk/c/axiom/include/axiom_data_handler.h
    webservices/axis2/trunk/c/axiom/src/attachments/data_handler.c
    webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c

Modified: webservices/axis2/trunk/c/axiom/include/axiom_data_handler.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/include/axiom_data_handler.h?view=diff&rev=464819&r1=464818&r2=464819
==============================================================================
--- webservices/axis2/trunk/c/axiom/include/axiom_data_handler.h (original)
+++ webservices/axis2/trunk/c/axiom/include/axiom_data_handler.h Mon Oct 16 22:45:58 2006
@@ -36,6 +36,12 @@
 {
 #endif
 
+typedef enum axiom_data_handler_type
+{
+    AXIOM_DATA_HANDLER_TYPE_FILE,
+    AXIOM_DATA_HANDLER_TYPE_BUFFER
+}axiom_data_handler_type_t;
+
 
 /* This should be moved to header file later axis2_defines.h*/    
 #define axis2_byte_t char
@@ -118,6 +124,7 @@
 axiom_data_handler_create (const axis2_env_t *env, 
     const axis2_char_t *file_name, 
     const axis2_char_t *mime_type);
+
 
 /*************************** Function macros **********************************/
 

Modified: webservices/axis2/trunk/c/axiom/src/attachments/data_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/attachments/data_handler.c?view=diff&rev=464819&r1=464818&r2=464819
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/data_handler.c (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/data_handler.c Mon Oct 16 22:45:58 2006
@@ -25,6 +25,7 @@
     axis2_char_t* file_name;
     axis2_byte_t* buffer;
     int buffer_len;
+    int data_handler_type;
 }
 axiom_data_handler_impl_t;
 
@@ -102,8 +103,13 @@
             AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
             return NULL;
         }
+        data_handler_impl->data_handler_type = AXIOM_DATA_HANDLER_TYPE_FILE;
     }
-
+    else
+    {
+        data_handler_impl->data_handler_type = AXIOM_DATA_HANDLER_TYPE_BUFFER;
+    }
+    
     data_handler_impl->data_handler.ops = AXIS2_MALLOC(env->allocator,
             sizeof(axiom_data_handler_ops_t));
     if (NULL == data_handler_impl->data_handler.ops)
@@ -123,6 +129,7 @@
     return &(data_handler_impl->data_handler);
 }
 
+
 /*************************** Start of op impls *************************/
 
 axis2_status_t AXIS2_CALL
@@ -172,8 +179,13 @@
 
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     data_handler_impl = AXIS2_INTF_TO_IMPL(data_handler);
-
-    if (data_handler_impl->file_name)
+    if(data_handler_impl->data_handler_type == AXIOM_DATA_HANDLER_TYPE_BUFFER)
+    {
+        *output_stream = data_handler_impl->buffer;
+        *output_stream_size = data_handler_impl->buffer_len;  
+    }
+    else if (data_handler_impl->data_handler_type == AXIOM_DATA_HANDLER_TYPE_FILE
+        &&  data_handler_impl->file_name)
     {
         FILE *f = NULL;
         axis2_byte_t *byte_stream = NULL;

Modified: webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c?view=diff&rev=464819&r1=464818&r2=464819
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c Mon Oct 16 22:45:58 2006
@@ -370,8 +370,9 @@
                 len = callback(buffer, size, (void*)callback_ctx);
                 if (len > 0)
                 {
-                    axis2_char_t *temp_mime_binary = mime_binary;
+                    axis2_char_t *temp_mime_binary = NULL;
                     count = 0;
+                    temp_mime_binary = mime_binary;
                     mime_binary = AXIS2_MALLOC(env->allocator,
                             sizeof(char) * (mime_binary_len + len + 1));
                     if (mime_binary)



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