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.
signature.asc
Description: PGP signature
_______________________________________________ Edbrowse-dev mailing list [email protected] http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev
