libsoup: GNOME's HTTP library

NOTE: This page is a recollection of what I've written previously. I do not guarantee it's accuracy.

LibSoup is the HTTP library which integrates into the GLib mainloop, and at it’s center is the SoupSession. This object manages a number of extensions (largely as a shallow wrapper around it’s signals), and a queue (in the form of a linked-list) of parsed HTTP SoupMessages.

When you tell LibSoup to fetch a URL it’ll look up the correct extension in a hashmap, which’ll usually just queue up a message on the connection’s queue after giving you a chance to edit it.

On that queue messages are run past several extensions and dispatched to the mainloop from which they came, before they’re dispatched to the appropriate SoupConnection and tracks it’s status in a state machine.

The SoupConnection then tells the SoupMessages to (de)serialize themselves to/from a SoupSocket, which in turn is a shallow wrapper around GIO streams with tight mainloop integration and optional GnuTLS integration.