[libsoup/wip/http2-a: 5/7] 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/wip/http2-a: 5/7] drop soup_session_get_queue(), add soup_session_lookup_queue_item()
- Date: Thu, 26 Feb 2015 15:50:32 +0000 (UTC)
commit 6893075d6615341d965ca3dd46486667c5dc7d6c
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 f2bd34b..ae9bb21 100644
--- a/libsoup/soup-session.c
+++ b/libsoup/soup-session.c
@@ -1479,12 +1479,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
@@ -2163,10 +2164,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) {
@@ -2262,14 +2262,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);
@@ -2343,14 +2341,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);
@@ -2366,10 +2362,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;
@@ -2414,14 +2409,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]