Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 48143 invoked from network); 14 Feb 2009 15:59:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Feb 2009 15:59:45 -0000 Received: (qmail 54718 invoked by uid 500); 14 Feb 2009 15:59:44 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 54586 invoked by uid 500); 14 Feb 2009 15:59:44 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 54577 invoked by uid 500); 14 Feb 2009 15:59:43 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 54574 invoked by uid 99); 14 Feb 2009 15:59:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Feb 2009 07:59:43 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Feb 2009 15:59:43 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D854C23888CA; Sat, 14 Feb 2009 15:59:22 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r744510 - /webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c Date: Sat, 14 Feb 2009 15:59:22 -0000 To: axis2-cvs@ws.apache.org From: manjula@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090214155922.D854C23888CA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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); }