Divelogs.de upload simplification

Dirk Hohndel dirk at hohndel.org
Tue Apr 28 11:39:20 PDT 2015


I didn't do a lot of searching in the git history, so I'm not quite sure
why we did things the way we did them, but when battling the Windows path
issue (aka libzip build issue) I spent a lot of time reading this code and
couldn't help but shake my head about what we were doing.

For every single dive we wanted to export, we wrote the dive to a
temporary file as XML. Then immediately read the file back into memory
where we processed it with an XSLT transformation. And then promptly
forgot to delete that temporary file. Oops.

Instead I changed the code to simply write the dive into a membuffer and
then hand a pointer to the actual buffer to the XSLT transformation. No
detour via the filesystem, no need to create temporary file names, no need
to delete the files. Faster, easier, less code.

Which of course has me worried that I'm missing something.

I did test this and it seems to work fine, but I'd appreciate if people
could give this a try. Lubomir, you wrote the original code... does this
make sense?

/D


More information about the subsurface mailing list