[PATCH] DLD upload

Lubomir I. Ivanov neolit123 at gmail.com
Wed Mar 13 16:05:24 PDT 2013


On 13 March 2013 23:24, Dirk Hohndel <dirk at hohndel.org> wrote:
> Dirk Hohndel <dirk at hohndel.org> writes:
>
>> "Lubomir I. Ivanov" <neolit123 at gmail.com> writes:
>>
>>> On 13 March 2013 16:51, Lubomir I. Ivanov <neolit123 at gmail.com> wrote:
>>>>
>>>> on the other hand, the libsoup re-write should be quite trivial, also
>>>> if i'm no mistaken we get easy SSL support, but that has to be
>>>> confirmed.
>>>>
>>>
>>> here is a (untested) libsoup variant for reference. as you can see
>>> it's more code even without the error checks, which seems typical for
>>> the gnome folks, even if the library capabilities are overall smaller
>>> in comparison to libcurl (as they say). but i really think we should
>>> move both the zip packaging code and the upload code to a new pair
>>> e.g. upload.c/upload.h. we then can use the same file to write a
>>> dialog and the same dialog to upload to different website platforms.
>>> but please, don't put this in divelist.c :-).
>>
>> Sadly you and I have written almost the same code at the same time - I
>> have a working libsoup implementation right now - sadly the DLD file
>> that we create is actually broken so the upload then fails. I'm
>> debugging that part right now...
>
> The zip file is corrupted and I can't figure out why - the code reads
> correct to me, but the first few bytes of each of the XML files inside
> the ZIP are corrupted. Even after repairing this and uploading a
> sane-looking "DLD" file to the website (using libsoup) the file still
> isn't parsed correctly.
>

i can confirm the corrupted bytes at the beginning. but it works if i
remove the two lines a the bottom of export_selected_dives_cb():

if (membuf)
	free((void *)membuf);

no idea why that happens. shouldn't we own the rights to the membuf
pointer even after the zip_add(), zip_source_buffer() calls, given the
memory there is allocated by us? huh...what's going on here.

lubomir
--


More information about the subsurface mailing list