Hi,
 
I modified data_handler.c to improve the efficieny of reading binary attachments.

Attachment: data_handler_diff.txt

Diff for files in modules/xml/attachments: data_handler_diff.txt

 

Thank You

Kapila

 

Index: modules/xml/attachments/data_handler.c
===================================================================
--- modules/xml/attachments/data_handler.c      (revision 398104)
+++ modules/xml/attachments/data_handler.c      (working copy)
@@ -185,7 +185,7 @@
             return AXIS2_FAILURE;
         
         do {
-            read_stream_size = 1024;
+           read_stream_size = 1024 * 1024;/*changed from 1024 to 1024 * 1024 */
             read_stream = AXIS2_MALLOC((*env)->allocator, (read_stream_size) * 
sizeof(axis2_byte_t));
             if (!read_stream)
             {
@@ -197,7 +197,7 @@
                 }
                 return AXIS2_FAILURE;
             }
-            count = fread(read_stream, 1, 1024, f);
+            count = fread(read_stream, 1, 1024 * 1024, f);
             if (ferror(f) != 0)
             {
                 /*TODO : need to set the correct error code */
Index: build.sh
===================================================================
--- build.sh    (revision 398104)
+++ build.sh    (working copy)
@@ -2,7 +2,7 @@
 ./autogen.sh
 AXIS2C_HOME=`pwd`/deploy
 export AXIS2C_HOME
-./configure --prefix=${AXIS2C_HOME} --enable-tests=yes --enable-trace=yes  
--with-apache2=/usr/include/apache2 --with-apr=/usr/include/apr-0 
--enable-diclient=no --enable-static=no
+./configure --prefix=${AXIS2C_HOME} --enable-tests=yes --enable-trace=yes 
--enable-diclient=no --enable-static=no
 make
 make install
 cd samples

Reply via email to