1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2003 Novell, Inc.
4 * Copyright (C) 2008 Red Hat, Inc.
7 #ifndef SOUP_MESSAGE_QUEUE_H
8 #define SOUP_MESSAGE_QUEUE_H 1
10 #include "soup-connection.h"
11 #include "soup-message.h"
12 #include "soup-session.h"
17 SOUP_MESSAGE_STARTING,
18 SOUP_MESSAGE_GOT_CONNECTION,
19 SOUP_MESSAGE_CONNECTING,
20 SOUP_MESSAGE_CONNECTED,
21 SOUP_MESSAGE_TUNNELING,
22 SOUP_MESSAGE_TUNNELED,
26 SOUP_MESSAGE_RESTARTING,
27 SOUP_MESSAGE_FINISHING,
29 } SoupMessageQueueItemState;
31 struct _SoupMessageQueueItem {
34 SoupMessageQueue *queue;
36 SoupSessionCallback callback;
37 gpointer callback_data;
38 GMainContext *async_context;
40 GCancellable *cancellable;
51 guint resend_count : 28;
53 SoupMessageQueueItemState state;
59 SoupMessageQueueItem *prev, *next;
60 SoupMessageQueueItem *related;
63 SoupMessageQueue *soup_message_queue_new (SoupSession *session);
64 SoupMessageQueueItem *soup_message_queue_append (SoupMessageQueue *queue,
66 SoupSessionCallback callback,
69 SoupMessageQueueItem *soup_message_queue_lookup (SoupMessageQueue *queue,
72 SoupMessageQueueItem *soup_message_queue_first (SoupMessageQueue *queue);
73 SoupMessageQueueItem *soup_message_queue_next (SoupMessageQueue *queue,
74 SoupMessageQueueItem *item);
76 void soup_message_queue_remove (SoupMessageQueue *queue,
77 SoupMessageQueueItem *item);
79 void soup_message_queue_destroy (SoupMessageQueue *queue);
81 void soup_message_queue_item_ref (SoupMessageQueueItem *item);
82 void soup_message_queue_item_unref (SoupMessageQueueItem *item);
86 #endif /* SOUP_MESSAGE_QUEUE_H */