Change the SoupURI properties to SoupAddress properties.
[platform/upstream/libsoup.git] / libsoup / soup-message-private.h
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Copyright (C) 2000-2003, Ximian, Inc.
4  */
5
6 #ifndef SOUP_MESSAGE_PRIVATE_H
7 #define SOUP_MESSAGE_PRIVATE_H 1
8
9 #include "soup-message.h"
10 #include "soup-auth.h"
11 #include "soup-connection.h"
12
13 typedef enum {
14         SOUP_MESSAGE_IO_STATUS_IDLE,
15         SOUP_MESSAGE_IO_STATUS_QUEUED,
16         SOUP_MESSAGE_IO_STATUS_CONNECTING,
17         SOUP_MESSAGE_IO_STATUS_RUNNING,
18         SOUP_MESSAGE_IO_STATUS_FINISHED
19 } SoupMessageIOStatus;
20
21 typedef struct {
22         gpointer           io_data;
23         SoupMessageIOStatus io_status;
24
25         SoupChunkAllocator chunk_allocator;
26         gpointer           chunk_allocator_data;
27         GDestroyNotify     chunk_allocator_dnotify;
28
29         guint              msg_flags;
30         gboolean           server_side;
31
32         SoupHTTPVersion    http_version, orig_http_version;
33
34         SoupURI           *uri;
35         SoupAddress       *addr;
36
37         SoupAuth          *auth, *proxy_auth;
38 } SoupMessagePrivate;
39 #define SOUP_MESSAGE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_MESSAGE, SoupMessagePrivate))
40
41 #define SOUP_MESSAGE_IS_STARTING(msg) (SOUP_MESSAGE_GET_PRIVATE (msg)->io_status == SOUP_MESSAGE_IO_STATUS_QUEUED || SOUP_MESSAGE_GET_PRIVATE (msg)->io_status == SOUP_MESSAGE_IO_STATUS_CONNECTING)
42
43 void             soup_message_cleanup_response (SoupMessage      *req);
44
45
46 typedef void     (*SoupMessageGetHeadersFn)  (SoupMessage      *msg,
47                                               GString          *headers,
48                                               SoupEncoding     *encoding,
49                                               gpointer          user_data);
50 typedef guint    (*SoupMessageParseHeadersFn)(SoupMessage      *msg,
51                                               char             *headers,
52                                               guint             header_len,
53                                               SoupEncoding     *encoding,
54                                               gpointer          user_data);
55
56 void           soup_message_send_request        (SoupMessage       *req,
57                                                  SoupSocket        *sock,
58                                                  SoupConnection    *conn,
59                                                  gboolean           via_proxy);
60 void           soup_message_read_request        (SoupMessage       *req,
61                                                  SoupSocket        *sock);
62
63 void soup_message_io_client  (SoupMessage               *msg,
64                               SoupSocket                *sock,
65                               SoupConnection            *conn,
66                               SoupMessageGetHeadersFn    get_headers_cb,
67                               SoupMessageParseHeadersFn  parse_headers_cb,
68                               gpointer                   user_data);
69 void soup_message_io_server  (SoupMessage               *msg,
70                               SoupSocket                *sock,
71                               SoupMessageGetHeadersFn    get_headers_cb,
72                               SoupMessageParseHeadersFn  parse_headers_cb,
73                               gpointer                   user_data);
74 void soup_message_io_cleanup (SoupMessage               *msg);
75
76 /* Auth handling */
77 void           soup_message_set_auth       (SoupMessage *msg,
78                                             SoupAuth    *auth);
79 SoupAuth      *soup_message_get_auth       (SoupMessage *msg);
80 void           soup_message_set_proxy_auth (SoupMessage *msg,
81                                             SoupAuth    *auth);
82 SoupAuth      *soup_message_get_proxy_auth (SoupMessage *msg);
83
84 /* I/O */
85 void                soup_message_set_io_status  (SoupMessage          *msg,
86                                                  SoupMessageIOStatus  status);
87 SoupMessageIOStatus soup_message_get_io_status  (SoupMessage          *msg);
88 void                soup_message_io_stop        (SoupMessage          *msg);
89 void                soup_message_io_pause       (SoupMessage          *msg);
90 void                soup_message_io_unpause     (SoupMessage          *msg);
91 gboolean            soup_message_io_in_progress (SoupMessage          *msg);
92
93 #endif /* SOUP_MESSAGE_PRIVATE_H */