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 sh...@apache.org on 2009/09/09 14:09:50 UTC
svn commit: r812915 -
/webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c
Author: shankar
Date: Wed Sep 9 12:09:50 2009
New Revision: 812915
URL: http://svn.apache.org/viewvc?rev=812915&view=rev
Log:
fixing the issue of additional two characters written when using callback
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=812915&r1=812914&r2=812915&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c Wed Sep 9 12:09:50 2009
@@ -1497,6 +1497,9 @@
* So we need to cache previous buffer and the data up to the starting
* point of the search string in the current buffer */
+ /* deduct last 2 CRLF character.
+ * For buffering case, it will be done when creating datahandler.*/
+
if(mime_parser->mtom_caching_callback)
{
status = AXIOM_MTOM_CACHING_CALLBACK_CACHE(mime_parser->mtom_caching_callback, env,
@@ -1505,7 +1508,7 @@
{
status
= AXIOM_MTOM_CACHING_CALLBACK_CACHE(mime_parser->mtom_caching_callback,
- env, buf_array[*buf_num], found - buf_array[*buf_num],
+ env, buf_array[*buf_num], found - buf_array[*buf_num] - 2,
search_info->handler);
}
}
@@ -1517,7 +1520,7 @@
if(status == AXIS2_SUCCESS)
{
status = axiom_mime_parser_cache_to_file(env, buf_array[*buf_num], found
- - buf_array[*buf_num], search_info->handler);
+ - buf_array[*buf_num] - 2, search_info->handler);
}
}
@@ -1542,13 +1545,13 @@
if(mime_parser->mtom_caching_callback)
{
status = AXIOM_MTOM_CACHING_CALLBACK_CACHE(mime_parser->mtom_caching_callback, env,
- buf_array[*buf_num - 1], search_info->match_len1, search_info->handler);
+ buf_array[*buf_num - 1], search_info->match_len1 - 2, search_info->handler);
}
else if(mime_parser->attachment_dir)
{
status = axiom_mime_parser_cache_to_file(env, buf_array[*buf_num - 1],
- search_info->match_len1, search_info->handler);
+ search_info->match_len1 - 2, search_info->handler);
}
else
{