[PATCH] DLD upload

Lubomir I. Ivanov neolit123 at gmail.com
Wed Mar 13 06:28:22 PDT 2013


2013/3/13 Robert C. Helling <helling at atdotde.de>:
>
>
> Hi,
>
> in the tradition of sending something semi-working in the hope somebody else finishes it, here is an implementation of the actual upload to divelogs.de.
>
> There are a number of things to note:
>
> 1) I was not able to understand the libsoup documentation as how one is supposed to upload a file (together with parameters in a POST operation). Thus I used libcurl. As I did this on my Mac I had to port install curl. I changed the Makefile accordingly.

frankly, the only reason i've used libsoup in the webservice dialog,
was due to how poorly the packaging (or lack off) of libcurl was done
for native windows, which may not be the case for the cross-build. if
you decide to use libcurl, we may as well re-write the other dialog to
use it, but that means that the native windows build is
out-of-the-game (which is not a biggie), until i find i way to build
libcurl or download from somewhere pre-built properly. since gnome
officially supports libsoup the integration was less painful, but i'm
also aware that libcurl is the more mature library out of the two.

>
> 2) On divelogs.de, I created an account "subsurface" test with password "geheim". Currently, these are hardcoded in divelist.c as I did not have time to learn how to modify the GUI to obtain this information from the user.
>
> 4) There is no error handling so far. Instead libcurl prints the result (some xml) to STDOUT and I have not yet figured out how to stop it.
>
> 5) My indentation is still horrible. All the .emacs stuff you friendly people sent so far did not help. I am really sorry about this.
>
> 6) I adopted this code from a coding example from the libcurl doc. That came with a boiler plate /***************************************************************************
>  *                                  _   _ ____  _
>  *  Project                     ___| | | |  _ \| |
>  *                             / __| | | | |_) | |
>  *                            | (__| |_| |  _ <| |___
>  *                             \___|\___/|_| \_\_____|
>  *
>  * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel at haxx.se>, et al.
>  *
>  * This software is licensed as described in the file COPYING, which
>  * you should have received as part of this distribution. The terms
>  * are also available at http://curl.haxx.se/docs/copyright.html.
>  *
>  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
>  * copies of the Software, and permit persons to whom the Software is
>  * furnished to do so, under the terms of the COPYING file.
>  *
>  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
>  * KIND, either express or implied.
>  *
>  ***************************************************************************/
> I understand, libcurl comes with a MIT license. I don't know if this creates any problems if it is included in a GPL'ed project. We might have to ask the curl author for permission.
>

AFAIK, the licenses are compatible where GPL2 "overpowers" the MIT
license, as can be confirmed here:
http://en.wikipedia.org/wiki/License_compatibility#GPL_compatibility

> If you still don't mind:
>
> Signed-off-by: Robert C. Helling <helling at atdotde.de>
>

lubomir
--


More information about the subsurface mailing list