← Back to team overview

kicad-developers team mailing list archive

Re: [rfc patch] replace avhttp with libcurl

 

Le 03/12/2015 07:47, Mark Roszko a écrit :
> Given that this:
> #include <avhttp.hpp>                       // chinese SSL magic
> 
> is literally in the source code on github_plugin.cpp:94
> 
> I have written a replacement implementation that drops avhttp in favor
> of libcurl.
> 
> All the linux distros have curl, even Windows has curl binaries(though
> msys2 will take care of it), OSX as well. Even git uses curl.
> 
> Benefits:
> No more need to link against openssl, ever, I hope.
> No need to deal with unpacking avhttp to build.
> Less boost usage!
> Documentation is in english
> Its API is extremely stable and mature
> 
> 
> So this patch
> 1. Removes avhttp and openssl dependency
> 2. Replaces avhttp logic in github plugin
> 3. Adds a KICAD_CURL_EASY wrapper class to /common/ for consumption in
> other parts of kicad.
> 4. Adds curl linkage in common
> 5. A KICAD_CURL::Init and Cleanup static functions were added to
> PGM_Base, in effect all the kicad apps are linking against libcurl.
> This was needed because curl_global_init must be called before any
> threads start using the rest of the curl functions which are thread
> safe. And you get the mess where cvpcb, pcbnew and kicad all end up
> using the github plugin through the whole process loading scheme.
> 
> 
>>From my testing it works via MSYS2/Windows, I can't imagine it being
> any different on a different OS as its libcurl afterall :)

I have issues on MSYS2/Windows 32bits.

At compil time, I have the warning:
In file included from C:/msys32/mingw32/include/curl/curlbuild.h:123:0,
                 from C:/msys32/mingw32/include/curl/curl.h:34,
                 from
E:/kicad-launchpad/essais/remove_avhttp/include/kicad_curl/kicad_curl_easy.h:27,
                 from
E:/kicad-launchpad/essais/remove_avhttp/pcbnew/github/github_getliblist.cpp:49:
C:/msys32/mingw32/i686-w64-mingw32/include/winsock2.h:15:2: warning:
#warning Please include winsock2.h before windows.h [-Wcpp]
 #warning Please include winsock2.h before windows.h

and unfortunately, at run time the error:
"IO_ERROR: CURL Request Failed: Problem with the SSL CA Cert (path?
access rights?)
from kicad_curl_easy.cpp:Perform(): line 157"


On Linux (Kubuntu 14.04) it works fine.

> 
> 
> Opinions,etc, etc. You probably still need to enable the github plugin
> to build it. curl is being linked regardless however.

-- 
Jean-Pierre CHARRAS


Follow ups

References