axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r410101 - in /webservices/axis2/trunk/c/axiom/src: attachments/mime_parser.c om/om_text.c
Date Mon, 29 May 2006 15:09:13 GMT
Author: samisa
Date: Mon May 29 08:09:13 2006
New Revision: 410101

URL: http://svn.apache.org/viewvc?rev=410101&view=rev
Log:
Added non optimized base64 MTOM attachment support

Modified:
    webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c
    webservices/axis2/trunk/c/axiom/src/om/om_text.c

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?rev=410101&r1=410100&r2=410101&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c Mon May 29 08:09:13 2006
@@ -391,7 +391,10 @@
         {
             /* get MIME ID */
             axis2_char_t *id = NULL;
-            id = AXIS2_STRSTR(body_mime, "content-id");
+            if (body_mime)
+            {
+                id = AXIS2_STRSTR(body_mime, "content-id");
+            }
             if (id)
             {
                 id += AXIS2_STRLEN("content-id");

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?rev=410101&r1=410100&r2=410101&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/om/om_text.c (original)
+++ webservices/axis2/trunk/c/axiom/src/om/om_text.c Mon May 29 08:09:13 2006
@@ -207,6 +207,8 @@
     om_text->om_text.ops->get_value = axis2_om_text_get_value;
     om_text->om_text.ops->get_data_handler = axis2_om_text_get_data_handler;
     om_text->om_text.ops->get_content_id = axis2_om_text_get_content_id;
+    om_text->om_text.ops->set_optimize = axis2_om_text_set_optimize;
+    om_text->om_text.ops->set_is_binary = axis2_om_text_set_is_binary;
     
     return &(om_text->om_text);
 }
@@ -582,7 +584,27 @@
     }
     else
     {
-        
+        axis2_char_t *data_handler_stream = NULL;
+        int data_handler_stream_size = 0;
+        if (om_text_impl->data_handler)
+        {
+            int encoded_len = 0;
+            axis2_char_t *encoded_str = NULL;
+            AXIS2_DATA_HANDLER_READ_FROM(om_text_impl->data_handler, env,
+                        &data_handler_stream, &data_handler_stream_size);
+            if (data_handler_stream)
+            {
+                encoded_len = axis2_base64_encode_len(data_handler_stream_size);
+                encoded_str = AXIS2_MALLOC((*env)->allocator, encoded_len);
+                if (encoded_str)
+                {
+                    encoded_len = axis2_base64_encode(encoded_str, 
+                        data_handler_stream, data_handler_stream_size);
+                    encoded_str[encoded_len] = '\0';
+                    return encoded_str;
+                }                
+            }
+        }
     }
     return om_text_impl->value;    
 }



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


Mime
View raw message