summaryrefslogtreecommitdiff
path: root/libsoup/soup-message-queue.h
Commit message (Collapse)AuthorAgeFilesLines
* SoupSession: propagate GErrors to callersDan Winship2013-10-191-0/+2
| | | | | | When using soup_session_send() or soup_session_send_async(), propagate underlying GErrors to the caller, rather than constructing fake SOUP_HTTP_ERROR errors.
* soup-message-queue: add a priority system to the message queueSergio Villar Senin2013-04-171-1/+2
| | | | | | | | Clients can specify a priority for each message added to the SoupSession, which will determine the order in which it is processed by the session's message processing queue. https://bugzilla.gnome.org/show_bug.cgi?id=696277
* SoupSession: break infinite loopsDan Winship2013-03-061-1/+1
| | | | | | | | Every year or two some bug comes up that makes libsoup retry a request infinitely. (Also, apps can do this on their own by not paying attention to the "retrying" flag in SoupSession::authenticate.) Move the "too many redirects" code and rework it to handle all possible cases of "message gets resent a suspicious number of times".
* SoupSession: remove some dead code, fix proxy error messagesDan Winship2013-02-161-2/+0
| | | | | | | | | | | | SoupMessageQueueItem's proxy_addr and proxy_uri fields were no longer being used, but they were still there, and SoupSession was trying to use item->proxy_uri to provide clarifying information on SOUP_STATUS_CANT_RESOLVE_PROXY / SOUP_STATUS_CANT_CONNECT_PROXY. Remove the unused fields, and fix SoupSession to get the proxy name from the SoupConnection instead. https://bugzilla.gnome.org/show_bug.cgi?id=680273
* soup-session: move cache handling hereDan Winship2012-12-261-0/+1
| | | | | | Move the SoupCache special handling from SoupRequestHTTP to SoupSession (as another step towards making SoupCache not such a magical special case hack that only works in certain situations).
* SoupSession: allow creating a "plain" SoupSession for use with new APIsDan Winship2012-12-101-1/+2
| | | | | | | | | | | In gio-based APIs, async vs sync is a function-level distinction, not a class-level distinction. Merge most of the existing SoupSessionAsync and SoupSessionSync code up into SoupSession, and make SoupSession non-abstract, so that you can create a SoupSession and then use either sync or async SoupRequest-based APIs on it. (The traditional APIs still require one of the traditional subclasses, although the code reorg does affect them in some ways, such as making SoupSessionAsync more thread-safe.)
* SoupSession: move some code from SoupMessageQueue hereDan Winship2012-11-021-2/+0
| | | | | | | Move soup_message_queue_item_set_connection() into SoupSession, since connection management is the session's job, not the queue's. Likewise, move the non-queue-item-specific parts of queue_message_restarted() into SoupSession.
* port to GTaskDan Winship2012-10-221-1/+1
|
* SoupSessionAsync: destroy the I/O GSource when returning a resultDan Winship2012-09-171-0/+1
| | | | | | | | When a soup_request_send_async() gets cancelled, we were leaving its GSource active, causing it to be triggered later, sometimes causing criticals. Fix that. https://bugzilla.gnome.org/show_bug.cgi?id=683404
* SoupSession: merge AWAITING_CONNECTION state into STARTINGDan Winship2012-08-251-1/+0
| | | | | The only thing STARTING did was move directly into AWAITING_CONNECTION, so there's no need for two separate states.
* Fix a few recent request API bugs, add some more testsDan Winship2012-05-031-1/+2
|
* Reorganize proxy resolution, and support SOCKS and other proxy typesDan Winship2012-04-281-4/+0
| | | | | | | | | | Push the proxy resolution code from SoupSession down into SoupConnection and SoupSocket. If using a SoupProxyResolverDefault, just enable proxy support on the GSocketClient instead (after adding "http" as an application protocol). This way we get support for SOCKS proxies (and any other proxies supported by GProxy types). https://bugzilla.gnome.org/show_bug.cgi?id=553269
* SoupHTTPRequest: O brave new world!Dan Winship2012-04-171-0/+2
| | | | | | | | | | Kill SoupHTTPInputStream, and have SoupHTTPRequest return the message's body_istream directly (with a little help from SoupSession and its subclasses). SoupHTTPRequest works synchronously now as well (though it's still the case that async only works with SoupSessionAsync and sync only works with SoupSessionSync). https://bugzilla.gnome.org/show_bug.cgi?id=591739
* SoupMessage: add network-event signalDan Winship2011-12-221-3/+4
| | | | | | Proxy the new GSocketClient::event signal and emit it on SoupMessage, when relevant, to allow (a) debugging, (b) status messages, (c) request timing, (d) fiddling with sockets
* Add SoupSession:use-thread-contextDan Winship2011-11-081-0/+1
| | | | | | | | | | | Add a SoupSession flag telling it to use g_main_context_get_thread_default() on a per-message basis, rather than using a single GMainContext for everything. In the simple case, this is just more glib-like API. In the more complicated case, it allows synchronously sending one or more messages on a SoupSessionAsync without running the main GMainLoop. https://bugs.webkit.org/show_bug.cgi?id=68238
* SoupSession: make pause/unpause work in any stateDan Winship2011-09-291-1/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=651146
* SoupSocket: port to GSocketConnection/GTlsConnectionDan Winship2010-12-071-3/+0
| | | | and remove libsoup's built-in TLS support, which is no longer needed
* SoupSession: continue reorg, remove remaining signal-based flow controlDan Winship2010-06-091-0/+1
| | | | | | | | | | Make the sessions more state-machiney and fix up soup_session_cancel_message() by having it set the message to the (new) FINISHING state and letting the session implementation pick it up from there. Remove the remaining "finished" and "restarted" signal handlers; move the base session's "finished" handler to "soup_session_unqueue_item" and call that from the right places in the subclasses.
* SoupSession: bind connections to messages sooner, improve conn failure caseDan Winship2010-06-091-0/+1
| | | | | | | | | | | | | | | | Rather than having connections be independent until a message is actually sent on them, assign them to queue items when they're created for them. This means that, eg, if another connection frees up while we're waiting for the first connection to connect, that we can't take advantage of that. But it simplifies a ton of other things. Also, if a new connection fails, don't fail every other message on that host; let them succeed or fail independently. When doing a CONNECT though, keep track of the queue item that necessitated it so we can error that out if the CONNECT fails, just like we would if the actual soup_connection_connect() had failed. https://bugzilla.gnome.org/show_bug.cgi?id=619633
* Add SoupMessageQueueItemState, remove SoupMessageIOStatusDan Winship2010-06-091-3/+21
| | | | | | SoupMessageIOStatus was always really more about the session than the message. (SoupServer I/O didn't use it at all.) Replace it with a new SoupMessageQueueItemState, on the queue item rather than the message.
* soup-message-io: use SoupMessageQueueItems and add SoupMessageCompletionFnDan Winship2010-06-091-7/+5
| | | | | | push SoupMessageQueueItem down into soup-message-io, and end the I/O process by calling a completion callback rather than emitting the SoupMessage signals directly, which gives the session greater control.
* SoupSession: count redirections and cancel the message after too manyJosé Millán Soto2010-06-081-0/+2
| | | | | | and add a test to redirect-test https://bugzilla.gnome.org/show_bug.cgi?id=604383
* Implement SoupProxyURIResolver, to replace SoupProxyResolverDan Winship2009-06-061-0/+1
| | | | | | | Simplifies implementations, allows for non-http proxy resolution, and allows authentication information to be passed. http://bugzilla.gnome.org/show_bug.cgi?id=580051
* SoupConnection/SoupSession reorg and cleanupDan Winship2009-06-061-0/+2
| | | | | | | Move CONNECT handling from SoupConnection to SoupSession so it works more like other requests. Generally clean up and simplify SoupConnection, and simplify the coordination between SoupSession and its subclasses.
* Fix hostname resolution behaviorDan Winship2009-06-061-3/+2
| | | | | | | | | | | | | | | | | | | | | Previously we went to some effort to resolve the message URI hostname to an IP address before figuring out proxies/connections, but this turns out to be wrong for multiple reasons: 1. Some hosts that send all requests via proxy don't even have a working DNS config. (http://bugzilla.gnome.org/show_bug.cgi?id=577532) 2. Apparently no one expects hostnames in requests to be matched against IP addresses in proxy ignore lists anyway. 3. The big web browsers all implement connection limits on a per-hostname basis, not a per-IP basis, and some web pages take advantage of this by using multiple aliases for the same host to get around the connection limit. Also update tests/proxy-test to verify that the hostname is not resolved when passing a request to a proxy.
* rename from libsoup.pc.in; the attempt to keep the source treeDan Winship2008-10-311-1/+2
| | | | | | | | | | | | | | | | | | | | | * libsoup-2.4.pc.in: rename from libsoup.pc.in; the attempt to keep the source tree API-version-generic wasn't really working, and we're probably not ever going to change the API version again anyway. * Makefile.am (pkgconfig_DATA): install the .pc file the normal way rather than using an install-data-local rule to rename the .pc file as we install it * libsoup/Makefile.am (libsoupincludedir): * tests/Makefile.am (LIBS): * docs/reference/Makefile.am (GTKDOC_LIBS): Say "2.4" everywhere, instead of 2.4 in some places and $(SOUP_API_VERSION) in others. * configure.in: updates for .pc renaming. Also, use AS_HELP_STRING() in AC_ARG_ENABLE() and AC_ARG_WITH() rules svn path=/trunk/; revision=1193
* new abstract base class for a SoupSessionFeature that determines whatDan Winship2008-10-311-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-proxy-resolver.c: new abstract base class for a SoupSessionFeature that determines what proxy to use for a given URI. * libsoup/soup-proxy-resolver-static.c: a SoupProxyResolver that always returns the same value. * libsoup/soup-session.c (set_property, get_property): implement the SOUP_SESSION_PROXY_URI property by creating/destroying a SoupProxyResolverStatic as needed. (soup_session_get_connection): Use the proxy address passed by the caller rather than priv->proxy_uri. * libsoup/soup-session-async.c (run_queue): if the session has a proxy resolver, use it, and pass the resolved proxy to soup_session_get_connection(). (request_restarted): clear the previously-resolved proxy address when restarting the message * libsoup/soup-session-sync.c (wait_for_connection): if the session has a proxy resolver, use it, and pass the resolved proxy to soup_session_get_connection(). * libsoup/soup-message-queue.h (SoupMessageQueueItem): add proxy-address-resolving fields * libsoup/soup-status.c (soup_status_proxify): moved from soup-connection; turn SOUP_STATUS_CANT_RESOLVE into SOUP_STATUS_CANT_RESOLVE_PROXY, and SOUP_STATUS_CANT_CONNECT into SOUP_STATUS_CANT_CONNECT_PROXY (and pass all other statuses through unchanged) svn path=/trunk/; revision=1192
* Change the SoupURI properties to SoupAddress properties.Dan Winship2008-10-031-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libsoup/soup-connection.c: Change the SoupURI properties to SoupAddress properties. * libsoup/soup-address.c (soup_address_resolve_async) (soup_address_resolve_sync): Redo slightly so that multiple simultaneous attempts to resolve the same address won't cause problems. (soup_address_hash_by_name, soup_address_equal_by_name): (soup_address_hash_by_ip, soup_address_equal_by_ip): methods to hash addresses by name or IP address * libsoup/soup-message.c (soup_message_get_address): gets a SoupAddress corresponding to the message's URI * libsoup/soup-auth-manager.c (SoupAuthHost): hash hosts by soup_address_hash_by_name() rather than by URI. * libsoup/soup-session.c (soup_session_get_connection): pass addresses to soup_connection_new(), not URIs. (SoupSessionHost): hash hosts by soup_address_hash_by_ip() rather than by URI. This requires that the addresses will have already been resolved by the SoupSession subclasses before calling soup_session_get_connection(), but also means that now requests made to different virtual hosts on the same IP address can share a connection. * libsoup/soup-message-queue.c (SoupMessageQueueItem): add address-resolving state * libsoup/soup-session-sync.c (process_queue_item): resolve the message's address before getting a connection * libsoup/soup-session-async.c (run_queue, resolve_msg_addr) (resolved_msg_addr): resolve the message's address before getting a connection (request_restarted): if the message gets requeued to a different host, we'll need to re-resolve the address. * libsoup/soup-uri.c (soup_uri_copy_root, soup_uri_host_hash) (soup_uri_host_equal): No longer needed * libsoup/soup-dns.c (do_async_callback): disconnect from the cancellable before invoking the callback * tests/proxy-test.c (tests): fix the 403 example; hostnames are resolved by the session now, even when sending to a proxy, so we need to use a hostname that actually exists svn path=/trunk/; revision=1179
* Make this more complicated, with a SoupMessageQueueItem to keep track ofDan Winship2008-10-031-24/+39
| | | | | | | | | | | | | | | | * libsoup/soup-message-queue.c: Make this more complicated, with a SoupMessageQueueItem to keep track of the session's per-message state. (Part of the process of moving session-related state out of SoupMessagePrivate.) * libsoup/soup-session.c: Update to work in terms of SoupMessageQueueItem * libsoup/soup-session-async.c: * libsoup/soup-session-sync.c: use SoupMessageQueueItem (and get rid of SoupSessionAsyncQueueData and SoupSessionSyncAsyncData). svn path=/trunk/; revision=1178
* Merge libsoup-2.4 branch to trunkDan Winship2008-01-151-7/+0
| | | | | | * Merge libsoup-2.4 branch to trunk svn path=/trunk/; revision=1041
* add G_BEGIN_DECLS / G_END_DECLS to all installed headers so that libsoupJonathon Jongsma2007-06-011-0/+4
| | | | | | | | | 2007-05-16 Jonathon Jongsma <jjongsma@gnome.org> * libsoup/*.h: add G_BEGIN_DECLS / G_END_DECLS to all installed headers so that libsoup can be used from C++ programs. #438776 svn path=/trunk/; revision=925
* add/fix gtk-doc comments, make functions match prototypes, etcDan Winship2005-06-141-0/+7
| | | | | | | * libsoup/*.[ch]: add/fix gtk-doc comments, make functions match prototypes, etc * docs/reference/*: update, fix, etc
* First draft at the new object to maintain formerly-global state. (Not yetDan Winship2003-09-021-0/+37
* libsoup/soup-session.c: First draft at the new object to maintain formerly-global state. (Not yet complete; still need to get rid of SoupContext). * libsoup/soup-message-queue.c: Data structure used by SoupSession * libsoup/soup-queue.c: Gone. Mostly moved into soup-session, but some bits went into soup-connection. * libsoup/soup-connection.c (soup_connection_send_request): New, to send a request on a connection. The connection updates its internal state and then hands off to soup_message_send_request. (request_done): Callback set up by soup_connection_send_request. Marks the connection as no-longer-in-use, and disconnects it if the message says to. (soup_connection_set_in_use, soup_connection_mark_old): No longer needed; the connection takes care of this itself now. (soup_connection_new_proxy): New, to create a new connection that is explicitly marked as being through an HTTP proxy. (soup_connection_new_tunnel): New, to create a new HTTPS connection through a proxy. (Includes the code to send the CONNECT.) * libsoup/soup-context.c (try_existing_connections): Don't need to call soup_connection_set_in_use. (try_create_connection): Use soup_connection_new, soup_connection_new_proxy, or soup_connection_new_tunnel as appropriate. * libsoup/soup-message.c (soup_message_prepare): Replaces queue_message. (soup_message_queue, soup_message_requeue, soup_message_prepare): Gone. This must be done via a SoupSession now. (soup_message_set_connection): don't need to mark in_use/not in_use. Also, msg->priv->socket is gone now. (soup_message_get_socket): Gone. * libsoup/soup-message-handlers.c (soup_message_run_handlers): Remove references to global handlers. (redirect_handler, authorize_handler): Moved to soup-session.c. * libsoup/soup-misc.c (soup_shutdown): Gone; just unref the session to shut down now. * libsoup/soup.h: add soup-session.h * libsoup/Makefile.am: updates * tests/auth-test.c, tests/get.c, tests/simple-proxy.c: Use SoupSession.