[libsoup/http2: 6/6] drop soup_session_get_queue(), add soup_session_lookup_queue_item()
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libsoup/http2: 6/6] drop soup_session_get_queue(), add soup_session_lookup_queue_item()
- Date: Wed, 11 Dec 2013 09:37:55 +0000 (UTC)
commit 7d3534ab41b90170619112f4d3e935767b407492
Author: Dan Winship <danw gnome org>
Date: Tue Dec 10 15:52:27 2013 +0100
drop soup_session_get_queue(), add soup_session_lookup_queue_item()
libsoup/soup-session-async.c | 4 +---
libsoup/soup-session-private.h | 3 ++-
libsoup/soup-session.c | 25 +++++++++----------------
3 files changed, 12 insertions(+), 20 deletions(-)
---
diff --git a/libsoup/soup-session-async.c b/libsoup/soup-session-async.c
index b935348..b72e252 100644
--- a/libsoup/soup-session-async.c
+++ b/libsoup/soup-session-async.c
@@ -104,14 +104,12 @@ static void
soup_session_async_cancel_message (SoupSession *session, SoupMessage *msg,
guint status_code)
{
- SoupMessageQueue *queue;
SoupMessageQueueItem *item;
SOUP_SESSION_CLASS (soup_session_async_parent_class)->
cancel_message (session, msg, status_code);
- queue = soup_session_get_queue (session);
- item = soup_message_queue_lookup (queue, msg);
+ item = soup_session_lookup_queue_item (session, msg);
if (!item)
return;
diff --git a/libsoup/soup-session-private.h b/libsoup/soup-session-private.h
index dc4d300..7da6781 100644
--- a/libsoup/soup-session-private.h
+++ b/libsoup/soup-session-private.h
@@ -13,7 +13,8 @@
G_BEGIN_DECLS
/* "protected" methods for subclasses */
-SoupMessageQueue *soup_session_get_queue (SoupSession *session);
+SoupMessageQueueItem *soup_session_lookup_queue_item (SoupSession *session,
+ SoupMessage *msg);
SoupMessageQueueItem *soup_session_append_queue_item (SoupSession *session,
SoupMessage *msg,
diff --git a/libsoup/soup-session.c b/libsoup/soup-session.c
index 8f58f69..4edf7f9 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1417,12 +1417,13 @@ connection_state_changed (GObject *object, GParamSpec *param, gpointer user_data
soup_session_kick_queue (session);
}
-SoupMessageQueue *
-soup_session_get_queue (SoupSession *session)
+SoupMessageQueueItem *
+soup_session_lookup_queue_item (SoupSession *session,
+ SoupMessage *msg)
{
SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
- return priv->queue;
+ return soup_message_queue_lookup (priv->queue, msg);
}
static void
@@ -2115,10 +2116,9 @@ soup_session_queue_message (SoupSession *session, SoupMessage *msg,
static void
soup_session_real_requeue_message (SoupSession *session, SoupMessage *msg)
{
- SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
SoupMessageQueueItem *item;
- item = soup_message_queue_lookup (priv->queue, msg);
+ item = soup_session_lookup_queue_item (session, msg);
g_return_if_fail (item != NULL);
if (item->resend_count >= SOUP_SESSION_MAX_RESEND_COUNT) {
@@ -2214,14 +2214,12 @@ void
soup_session_pause_message (SoupSession *session,
SoupMessage *msg)
{
- SoupSessionPrivate *priv;
SoupMessageQueueItem *item;
g_return_if_fail (SOUP_IS_SESSION (session));
g_return_if_fail (SOUP_IS_MESSAGE (msg));
- priv = SOUP_SESSION_GET_PRIVATE (session);
- item = soup_message_queue_lookup (priv->queue, msg);
+ item = soup_session_lookup_queue_item (session, msg);
g_return_if_fail (item != NULL);
g_return_if_fail (item->async);
@@ -2295,14 +2293,12 @@ void
soup_session_unpause_message (SoupSession *session,
SoupMessage *msg)
{
- SoupSessionPrivate *priv;
SoupMessageQueueItem *item;
g_return_if_fail (SOUP_IS_SESSION (session));
g_return_if_fail (SOUP_IS_MESSAGE (msg));
- priv = SOUP_SESSION_GET_PRIVATE (session);
- item = soup_message_queue_lookup (priv->queue, msg);
+ item = soup_session_lookup_queue_item (session, msg);
g_return_if_fail (item != NULL);
g_return_if_fail (item->async);
@@ -2318,10 +2314,9 @@ soup_session_unpause_message (SoupSession *session,
static void
soup_session_real_cancel_message (SoupSession *session, SoupMessage *msg, guint status_code)
{
- SoupSessionPrivate *priv = SOUP_SESSION_GET_PRIVATE (session);
SoupMessageQueueItem *item;
- item = soup_message_queue_lookup (priv->queue, msg);
+ item = soup_session_lookup_queue_item (session, msg);
g_return_if_fail (item != NULL);
item->paused = FALSE;
@@ -2366,14 +2361,12 @@ void
soup_session_cancel_message (SoupSession *session, SoupMessage *msg,
guint status_code)
{
- SoupSessionPrivate *priv;
SoupMessageQueueItem *item;
g_return_if_fail (SOUP_IS_SESSION (session));
g_return_if_fail (SOUP_IS_MESSAGE (msg));
- priv = SOUP_SESSION_GET_PRIVATE (session);
- item = soup_message_queue_lookup (priv->queue, msg);
+ item = soup_session_lookup_queue_item (session, msg);
/* If the message is already ending, don't do anything */
if (!item)
return;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]