Well, I see there're lots of changes in
ddocSaxExtractDataFile ver. 2.2.11 compared to the
version which is available through CVS. I don't know
which is the stable version of the DigiDoc Library. I
use the newest - 2.2.11 and I have a strange error when
I extract a datafile (I think it happens only if the
file is greater than about 1KB). The file is extracted
properly, but I get error code 16 from
ddocSaxExtractDataFile(). I traced the problem and it
happened to be in pctx.bCollectDFData. I don't get what
bypass mode is, but it seems to me that bCollectDFData
is not properly incremented/decremented. These are the
last few line of the debug output :
------
PgogICAgPC9oaW50PgogICA8L2hpbnRzPgogIDwvY29ubmVjdGlvbj4KIDwvY29u
bmVjdGlvbnM+CjwvdWk+Cg==
</DataFile></DataFile></DataFile></SignedDoc>
extractEndElementHandler [2006-10-04 16:08:32]
DF: D0 end ignore: 0 skip: 1
extractEndElementHandler [2006-10-04 16:08:32]
DF: D0 mode: UTF-8, time: 0 [sek] total: 5728 bytes
errorHandler [2006-10-04 16:08:32] Opening and
ending tag mismatch: SignedDoc line 0 and DataFile
------
Obviously, the problem is in the cycle (at line 2301
from DigiDocSAXParser.c) :
-----------
for (i = 0; i < pctx.bCollectDFData ; i++) {
strcat(chars, "</DataFile>");
}
------------
My temporary fix is to decrease the "for" cycles with
2. That is :
-----------
for (i = 0; i < pctx.bCollectDFData - 2; i++) {
strcat(chars, "</DataFile>");
}
------------
I haven't got any errors since this change.
Any comments are appreciated.