/pidgin/main: e6c37a5e6666: New dependency: libcurl

Tomasz Wasilczyk tomkiewicz.groups at gmail.com
Mon Oct 1 14:30:24 EDT 2012


I've digged some more around these http libraries:

- libcurl perfectly fits into purple event loop (see my
implementation); libsoup doesn't seems to provide such possibility,
but there is a way to swich GMainContext. However, I still don't know,
how to get it working with libpurple

- libcurl doesn't provide any callbacks to SSL verifying functions.
Although, it provides CURLOPT_CAINFO, CURLOPT_ISSUERCERT,
CURLOPT_CAPATH, which can allow us to inject our internally setup
certs

- libcurl provides callback function for creating a socket, but it
have to return socket fd at once (libpurple returns estabilished
connection within a callback) AND it gets only ip addresses to connect
to (don't get http proxy benefits with passing an url). However, it
supports all proxies, that libpurple supports (see CURLOPT_PROXYTYPE)
- we can just inject it

- I think, libcurl may be hacked to operate on "faked" sockets, to
force it using our socket creating function (proxy api), but I think
it may lead to more problems than it solves. See
CURLOPT_WRITEFUNCTION, CURL_WRITEFUNC_PAUSE, CURLOPT_READFUNCTION,
CURLOPT_OPENSOCKETFUNCTION (this one could return our "faked" socket
identifier instead of real socket).

- I don't see any possibility to inject our DNS resolver functions to libcurl


Another thought about totally wrapping http library into our
abstraction: there is really a lot to wrap. Also, if we don't wrap
_everything_ we should to and make an option to provide user-specified
http plugin for libpurple (I mean: we make plugin side also a part of
API), there may be a necessity to wait for libpurple 4.0.0 to
introduce such new features (require them from such http support
plugins).

Tomek




More information about the Devel mailing list