1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2000-2003, Ximian, Inc.
6 #ifndef __SOUP_MESSAGE_PRIVATE_H__
7 #define __SOUP_MESSAGE_PRIVATE_H__ 1
9 #include "soup-message.h"
10 #include "soup-auth.h"
11 #include "soup-content-processor.h"
12 #include "soup-content-sniffer.h"
13 #include "soup-session.h"
18 SoupChunkAllocator chunk_allocator;
19 gpointer chunk_allocator_data;
20 GDestroyNotify chunk_allocator_dnotify;
25 SoupContentSniffer *sniffer;
26 gsize bytes_for_sniffing;
28 SoupHTTPVersion http_version, orig_http_version;
33 SoupAuth *auth, *proxy_auth;
34 SoupConnection *connection;
36 GHashTable *disabled_features;
39 SoupURI *site_for_cookies;
41 GTlsCertificate *tls_certificate;
42 GTlsCertificateFlags tls_errors;
46 SoupMessagePriority priority;
48 gboolean is_top_level_navigation;
51 void soup_message_cleanup_response (SoupMessage *msg);
54 SOUP_MESSAGE_IO_COMPLETE,
55 SOUP_MESSAGE_IO_INTERRUPTED,
56 SOUP_MESSAGE_IO_STOLEN
57 } SoupMessageIOCompletion;
59 typedef void (*SoupMessageGetHeadersFn) (SoupMessage *msg,
61 SoupEncoding *encoding,
63 typedef guint (*SoupMessageParseHeadersFn)(SoupMessage *msg,
66 SoupEncoding *encoding,
69 typedef void (*SoupMessageCompletionFn) (SoupMessage *msg,
70 SoupMessageIOCompletion completion,
74 void soup_message_send_request (SoupMessageQueueItem *item,
75 SoupMessageCompletionFn completion_cb,
77 void soup_message_read_request (SoupMessage *msg,
79 gboolean use_thread_context,
80 SoupMessageCompletionFn completion_cb,
83 void soup_message_io_client (SoupMessageQueueItem *item,
85 GMainContext *async_context,
86 SoupMessageGetHeadersFn get_headers_cb,
87 SoupMessageParseHeadersFn parse_headers_cb,
88 gpointer headers_data,
89 SoupMessageCompletionFn completion_cb,
91 void soup_message_io_server (SoupMessage *msg,
93 GMainContext *async_context,
94 SoupMessageGetHeadersFn get_headers_cb,
95 SoupMessageParseHeadersFn parse_headers_cb,
96 gpointer headers_data,
97 SoupMessageCompletionFn completion_cb,
101 void soup_message_set_auth (SoupMessage *msg,
103 SoupAuth *soup_message_get_auth (SoupMessage *msg);
104 void soup_message_set_proxy_auth (SoupMessage *msg,
106 SoupAuth *soup_message_get_proxy_auth (SoupMessage *msg);
109 void soup_message_io_stop (SoupMessage *msg);
110 void soup_message_io_finished (SoupMessage *msg);
111 /* This is supposed to be private, but there are programs that rely on it
112 * being exported. See bug #687758, #687468.
114 SOUP_AVAILABLE_IN_2_4
115 void soup_message_io_cleanup (SoupMessage *msg);
116 void soup_message_io_pause (SoupMessage *msg);
117 void soup_message_io_unpause (SoupMessage *msg);
118 gboolean soup_message_io_in_progress (SoupMessage *msg);
119 GIOStream *soup_message_io_steal (SoupMessage *msg);
122 gboolean soup_message_io_run_until_write (SoupMessage *msg,
124 GCancellable *cancellable,
126 gboolean soup_message_io_run_until_read (SoupMessage *msg,
128 GCancellable *cancellable,
130 gboolean soup_message_io_run_until_finish (SoupMessage *msg,
132 GCancellable *cancellable,
135 typedef gboolean (*SoupMessageSourceFunc) (SoupMessage *, gpointer);
136 GSource *soup_message_io_get_source (SoupMessage *msg,
137 GCancellable *cancellable,
138 SoupMessageSourceFunc callback,
141 GInputStream *soup_message_io_get_response_istream (SoupMessage *msg,
144 gboolean soup_message_disables_feature (SoupMessage *msg,
147 GList *soup_message_get_disabled_features (SoupMessage *msg);
149 void soup_message_set_https_status (SoupMessage *msg,
150 SoupConnection *conn);
152 void soup_message_network_event (SoupMessage *msg,
153 GSocketClientEvent event,
154 GIOStream *connection);
156 GInputStream *soup_message_setup_body_istream (GInputStream *body_stream,
158 SoupSession *session,
159 SoupProcessingStage start_at_stage);
161 void soup_message_set_soup_request (SoupMessage *msg,
164 SoupConnection *soup_message_get_connection (SoupMessage *msg);
165 void soup_message_set_connection (SoupMessage *msg,
166 SoupConnection *conn);
168 gpointer soup_message_get_io_data (SoupMessage *msg);
169 void soup_message_set_io_data (SoupMessage *msg,
172 SoupContentSniffer *soup_message_get_content_sniffer (SoupMessage *msg);
173 void soup_message_set_content_sniffer (SoupMessage *msg,
174 SoupContentSniffer *sniffer);
175 void soup_message_set_bytes_for_sniffing (SoupMessage *msg,
178 gboolean soup_message_has_chunk_allocator (SoupMessage *msg);
179 SoupBuffer *soup_message_allocate_chunk (SoupMessage *msg,
180 goffset read_length);
182 #endif /* __SOUP_MESSAGE_PRIVATE_H__ */