Re: [xml] Question about memory constraints when using SAX parser

Isn't there already Aleksey Sanins xmlsec lib at:


Veiko Sinivee wrote:

I'm writing a digital signature and xml encryption library. I want
to support encryption & decryption of very large files too. Well
encryption goes fine because I read, encrypt, base64 encode and write
data to the file in blocks of 8 KB or so. For decryption I choose to use
the SAX interface because it's probably the fastest and requires the 
least amount of memory. Now I found, that xmlCharaters() callback
function is still called with a lot of data. Earlier versions of libxml2
used to return data in blocks of x KB. Now If I have something like:

700 MB of base64 encoded data here

then the parser attempts to collect all of that data and return it
in one event to my callback function. This obviously doesn't work.
How can I switch it out and tell the parser to return at most x KB
in any event ?


Veiko Sinivee

xml mailing list, project page
xml gnome org

      \|/            Stefan Kost
     <@ @>           private            business
+-oOO-(_)-OOo------------------------------------------------------ - - -  -   -
|       __  Address  Simildenstr. 5     HTWK Leipzig, Fb IMN, Postfach 301166
|      ///           04277 Leipzig      04251 Leipzig
| __  ///            Germany            Germany
| \\\///    Phone    +49341 2253538     +49341 30766101
|  \__/     EMail
|           WWW
===-=-=--=---=---------------------------------- - - -  -    -

Attachment: kost.vcf
Description: Vcard

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]