axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From manj...@apache.org
Subject svn commit: r744510 - /webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c
Date Sat, 14 Feb 2009 15:59:22 GMT
Author: manjula
Date: Sat Feb 14 15:59:22 2009
New Revision: 744510

URL: http://svn.apache.org/viewvc?rev=744510&view=rev
Log:
Handling single buffer case more correctly.

Modified:
    webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.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=744510&r1=744509&r2=744510&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c Sat Feb 14 15:59:22 2009
@@ -439,7 +439,9 @@
 
             /* Here we need to check for more data, because if the message is too small
              * comapred to the reading size there may be no data in the stream , instead
-             * all the remaining data may be in the buffer */            
+             * all the remaining data may be in the buffer.And if there are no more data
+             * we will set the len to be 0. Otherwise len_array will contain wrong lenghts.
+             */            
 
             if(axiom_mime_parser_is_more_data(mime_parser, env, callback_info))
             {
@@ -447,7 +449,11 @@
 
                 len = callback(buffer + malloc_len, size - malloc_len, (void *) callback_ctx);
          
             }
-            
+            else
+            {
+                len = 0;
+            }            
+
             /* We do not need the data in the previous buffers once we found a particular
              * string and after worked with those buffers */
     
@@ -490,6 +496,10 @@
             {
                 len = callback(buffer + malloc_len, size - malloc_len, (void *) callback_ctx);
             }
+            else
+            {
+                len = 0;
+            }
             axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num);
             if(len >= 0)
             {
@@ -572,7 +582,10 @@
                 {
                     len = callback(buffer + malloc_len, size - malloc_len, (void *) callback_ctx);
                 }
-
+                else
+                {
+                    len = 0;
+                }
                 axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num);
                 if(len >= 0)
                 {
@@ -626,6 +639,10 @@
                 {
                     len = callback(buffer + malloc_len, size - malloc_len, (void *) callback_ctx);
                 }
+                else
+                {
+                    len = 0;
+                }
                 axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num);
                 if(len >= 0)
                 {
@@ -806,7 +823,10 @@
                     {
                         len = callback(buffer + malloc_len, size - malloc_len, (void *) callback_ctx);
                     }
-
+                    else
+                    {
+                        len = 0;
+                    }
                     axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num);
                     if(len >= 0)
                     {
@@ -857,6 +877,10 @@
                     {
                         len = callback(buffer + malloc_len, size - malloc_len, (void *) callback_ctx);
                     }
+                    else
+                    {
+                        len = 0;
+                    }
                     axiom_mime_parser_clear_buffers(env, buf_array, part_start, buf_num);
                     if(len >= 0)
                     {
@@ -983,6 +1007,10 @@
                         {
                             len = callback(buffer + malloc_len, size - malloc_len, (void
*) callback_ctx);        
                         }
+                        else
+                        {
+                            len = 0;
+                        }
                         if(len >= 0)
                         {
                             len_array[buf_num] = malloc_len + len;
@@ -1021,6 +1049,10 @@
                         {
                             len = callback(buffer + malloc_len, size - malloc_len, (void
*) callback_ctx);
                         }
+                        else
+                        {
+                            len = 0;
+                        }
                         if(len >= 0)
                         {
                             len_array[buf_num] = malloc_len + len;
@@ -2196,7 +2228,7 @@
 
         mime_parser->mtom_caching_callback =  (axiom_mtom_caching_callback_t *)ptr;
         mime_parser->mtom_caching_callback->param = impl_info_param;
-        /* mime_parser->mtom_caching_callback->user_param = user_param; */
+        mime_parser->mtom_caching_callback->user_param = user_param;
 
         return AXIOM_MTOM_CACHING_CALLBACK_INIT_HANDLER(mime_parser->mtom_caching_callback,
env, mime_id);
     }



Mime
View raw message