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
13 #include "soup-connection.h"
14 #include "soup-message.h"
15 #include "soup-session.h"
20 SOUP_MESSAGE_STARTING,
21 SOUP_MESSAGE_RESOLVING_PROXY_URI,
22 SOUP_MESSAGE_RESOLVED_PROXY_URI,
23 SOUP_MESSAGE_RESOLVING_PROXY_ADDRESS,
24 SOUP_MESSAGE_RESOLVED_PROXY_ADDRESS,
25 SOUP_MESSAGE_AWAITING_CONNECTION,
26 SOUP_MESSAGE_GOT_CONNECTION,
27 SOUP_MESSAGE_CONNECTING,
28 SOUP_MESSAGE_CONNECTED,
29 SOUP_MESSAGE_TUNNELING,
30 SOUP_MESSAGE_TUNNELED,
33 SOUP_MESSAGE_RESTARTING,
35 } SoupMessageQueueItemState;
37 struct _SoupMessageQueueItem {
40 SoupMessageQueue *queue;
42 SoupSessionCallback callback;
43 gpointer callback_data;
45 GCancellable *cancellable;
46 SoupAddress *proxy_addr;
50 guint redirection_count;
52 SoupMessageQueueItemState state;
57 SoupMessageQueueItem *prev, *next;
58 SoupMessageQueueItem *related;
61 SoupMessageQueue *soup_message_queue_new (SoupSession *session);
62 SoupMessageQueueItem *soup_message_queue_append (SoupMessageQueue *queue,
64 SoupSessionCallback callback,
67 SoupMessageQueueItem *soup_message_queue_lookup (SoupMessageQueue *queue,
70 SoupMessageQueueItem *soup_message_queue_first (SoupMessageQueue *queue);
71 SoupMessageQueueItem *soup_message_queue_next (SoupMessageQueue *queue,
72 SoupMessageQueueItem *item);
74 void soup_message_queue_remove (SoupMessageQueue *queue,
75 SoupMessageQueueItem *item);
77 void soup_message_queue_item_ref (SoupMessageQueueItem *item);
78 void soup_message_queue_item_unref (SoupMessageQueueItem *item);
80 void soup_message_queue_destroy (SoupMessageQueue *queue);
85 #endif /* SOUP_MESSAGE_QUEUE_H */