edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev] curl handles and general comms design
@ 2015-12-29 19:17 Adam Thompson
  2015-12-29 19:57 ` Karl Dahlke
  2016-01-05  0:38 ` Chris Brannon
  0 siblings, 2 replies; 9+ messages in thread
From: Adam Thompson @ 2015-12-29 19:17 UTC (permalink / raw)
  To: Edbrowse-dev

[-- Attachment #1: Type: text/plain, Size: 1937 bytes --]

Hi,

I noticed in a recent commit that we're now not keeping curl handles around.
We probably don't want to head in this direction since that also means we're
not doing persistant connections or correct things with cookies.
I also notice that Edbrowse appears to be performing *extremely* poorly (yeah I
know we're looking for functionality first, but still...).
I'm not sure if the two things are related or not but it prompted me to have a
closer look at curl. I've listed some of what I found below,
along with how I think we *could* use it.

First of all, it seems the curl devs and I and Karl (I think?)
were thinking along the same lines in terms of single-threaded multiplexed curl transfers.
To accomplish this there's a curl-multi interface which allows multiple
concurrent transfers with either an event-driven or fd-based (read select or 
poll) API.
What this basically means is that we can add curl handles to a stack and then
use an event loop to call curl_multi_perform and curl will handle all the
multiplexing for us, telling us when things need attention.
This also gets us connection sharing and dns cache sharing.

To solve the parallel curl handles accessing cookie databases issue,
there's also the curl-shared interface.
I believe this can be used with the curl-multi interface since the curl-multi
interface is single-threaded so no need for mutexes etc.
This allows us to share cookies between curl handles as well as other data
should we need them.

What this all means I think is that, by combining both interfaces,
we should be able to create a single-threaded, essentially async, comms layer.
This should also fix some of the strange cookie issues we have,
as well as allow us to better use persistant connections and dns caching.
I'm not sure if I'll have time to actually do the coding for this or not,
but I think it's worth discussing.

Any thoughts?

Cheers,
Adam.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-08 19:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-29 19:17 [Edbrowse-dev] curl handles and general comms design Adam Thompson
2015-12-29 19:57 ` Karl Dahlke
2015-12-29 22:27   ` Chris Brannon
2015-12-30 12:01   ` Adam Thompson
2015-12-30 12:26     ` Karl Dahlke
2015-12-30 13:22       ` Adam Thompson
2015-12-30 13:41         ` Karl Dahlke
2016-01-05  0:38 ` Chris Brannon
2016-01-08 19:43   ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).