Remove build warning
[platform/upstream/libsoup.git] / libsoup / soup-message-queue.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2003 Novell, Inc.
4  * Copyright (C) 2008 Red Hat, Inc.
5  */
6
7 #ifndef SOUP_MESSAGE_QUEUE_H
8 #define SOUP_MESSAGE_QUEUE_H 1
9
10 #include "soup-connection.h"
11 #include "soup-message.h"
12 #include "soup-session.h"
13
14 G_BEGIN_DECLS
15
16 typedef enum {
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,
23         SOUP_MESSAGE_READY,
24         SOUP_MESSAGE_RUNNING,
25         SOUP_MESSAGE_CACHED,
26         SOUP_MESSAGE_RESTARTING,
27         SOUP_MESSAGE_FINISHING,
28         SOUP_MESSAGE_FINISHED
29 } SoupMessageQueueItemState;
30
31 struct _SoupMessageQueueItem {
32         /*< public >*/
33         SoupSession *session;
34         SoupMessageQueue *queue;
35         SoupMessage *msg;
36         SoupSessionCallback callback;
37         gpointer callback_data;
38         GMainContext *async_context;
39
40         GCancellable *cancellable;
41         GError *error;
42
43         SoupConnection *conn;
44         GTask *task;
45         GSource *io_source;
46
47         guint paused            : 1;
48         guint new_api           : 1;
49         guint io_started        : 1;
50         guint async             : 1;
51         guint resend_count      : 28;
52
53         SoupMessageQueueItemState state;
54
55         /*< private >*/
56         guint removed              : 1;
57         guint priority             : 3;
58         guint ref_count            : 28;
59         SoupMessageQueueItem *prev, *next;
60         SoupMessageQueueItem *related;
61 };
62
63 SoupMessageQueue     *soup_message_queue_new        (SoupSession          *session);
64 SoupMessageQueueItem *soup_message_queue_append     (SoupMessageQueue     *queue,
65                                                      SoupMessage          *msg,
66                                                      SoupSessionCallback   callback,
67                                                      gpointer              user_data);
68
69 SoupMessageQueueItem *soup_message_queue_lookup     (SoupMessageQueue     *queue,
70                                                      SoupMessage          *msg);
71
72 SoupMessageQueueItem *soup_message_queue_first      (SoupMessageQueue     *queue);
73 SoupMessageQueueItem *soup_message_queue_next       (SoupMessageQueue     *queue,
74                                                      SoupMessageQueueItem *item);
75
76 void                  soup_message_queue_remove     (SoupMessageQueue     *queue,
77                                                      SoupMessageQueueItem *item);
78
79 void                  soup_message_queue_destroy    (SoupMessageQueue     *queue);
80
81 void soup_message_queue_item_ref            (SoupMessageQueueItem *item);
82 void soup_message_queue_item_unref          (SoupMessageQueueItem *item);
83
84 G_END_DECLS
85
86 #endif /* SOUP_MESSAGE_QUEUE_H */