1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
|
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* Copyright (C) 2000-2003, Ximian, Inc.
*/
#ifndef __SOUP_SESSION_H__
#define __SOUP_SESSION_H__ 1
#include "soup-types.h"
#include "soup-message.h"
#include "websocket/soup-websocket-connection.h"
G_BEGIN_DECLS
#define SOUP_TYPE_SESSION (soup_session_get_type ())
#define SOUP_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_SESSION, SoupSession))
#define SOUP_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_SESSION, SoupSessionClass))
#define SOUP_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_SESSION))
#define SOUP_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_SESSION))
#define SOUP_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_SESSION, SoupSessionClass))
typedef void (*SoupSessionCallback) (SoupSession *session,
SoupMessage *msg,
gpointer user_data);
struct _SoupSession {
GObject parent;
};
typedef struct {
GObjectClass parent_class;
/* signals */
void (*request_started) (SoupSession *session, SoupMessage *msg,
SoupSocket *socket);
void (*authenticate) (SoupSession *session, SoupMessage *msg,
SoupAuth *auth, gboolean retrying);
/* methods */
void (*auth_required) (SoupSession *session, SoupMessage *msg,
SoupAuth *auth, gboolean retrying);
/* Padding for future expansion */
void (*_libsoup_reserved4) (void);
} SoupSessionClass;
SOUP_AVAILABLE_IN_2_42
GType soup_session_get_type (void);
#define SOUP_SESSION_LOCAL_ADDRESS "local-address"
#define SOUP_SESSION_PROXY_RESOLVER "proxy-resolver"
#define SOUP_SESSION_MAX_CONNS "max-conns"
#define SOUP_SESSION_MAX_CONNS_PER_HOST "max-conns-per-host"
#define SOUP_SESSION_SSL_USE_SYSTEM_CA_FILE "ssl-use-system-ca-file"
#define SOUP_SESSION_TLS_DATABASE "tls-database"
#define SOUP_SESSION_SSL_STRICT "ssl-strict"
#define SOUP_SESSION_TLS_INTERACTION "tls-interaction"
#define SOUP_SESSION_TIMEOUT "timeout"
#define SOUP_SESSION_USER_AGENT "user-agent"
#define SOUP_SESSION_ACCEPT_LANGUAGE "accept-language"
#define SOUP_SESSION_ACCEPT_LANGUAGE_AUTO "accept-language-auto"
#define SOUP_SESSION_IDLE_TIMEOUT "idle-timeout"
#define SOUP_SESSION_ADD_FEATURE "add-feature"
#define SOUP_SESSION_ADD_FEATURE_BY_TYPE "add-feature-by-type"
#define SOUP_SESSION_REMOVE_FEATURE_BY_TYPE "remove-feature-by-type"
#define SOUP_SESSION_HTTP_ALIASES "http-aliases"
#define SOUP_SESSION_HTTPS_ALIASES "https-aliases"
SOUP_AVAILABLE_IN_2_42
SoupSession *soup_session_new (void);
SOUP_AVAILABLE_IN_2_42
SoupSession *soup_session_new_with_options (const char *optname1,
...) G_GNUC_NULL_TERMINATED;
SOUP_AVAILABLE_IN_2_4
void soup_session_queue_message (SoupSession *session,
SoupMessage *msg,
SoupSessionCallback callback,
gpointer user_data);
SOUP_AVAILABLE_IN_2_4
void soup_session_requeue_message (SoupSession *session,
SoupMessage *msg);
SOUP_AVAILABLE_IN_2_4
guint soup_session_send_message (SoupSession *session,
SoupMessage *msg);
SOUP_AVAILABLE_IN_2_4
void soup_session_pause_message (SoupSession *session,
SoupMessage *msg);
SOUP_AVAILABLE_IN_2_4
void soup_session_unpause_message (SoupSession *session,
SoupMessage *msg);
SOUP_AVAILABLE_IN_2_4
void soup_session_cancel_message (SoupSession *session,
SoupMessage *msg,
guint status_code);
SOUP_AVAILABLE_IN_2_4
void soup_session_abort (SoupSession *session);
SOUP_AVAILABLE_IN_2_42
void soup_session_send_async (SoupSession *session,
SoupMessage *msg,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
SOUP_AVAILABLE_IN_2_42
GInputStream *soup_session_send_finish (SoupSession *session,
GAsyncResult *result,
GError **error);
SOUP_AVAILABLE_IN_2_42
GInputStream *soup_session_send (SoupSession *session,
SoupMessage *msg,
GCancellable *cancellable,
GError **error);
SOUP_AVAILABLE_IN_2_38
void soup_session_prefetch_dns (SoupSession *session,
const char *hostname,
GCancellable *cancellable);
SOUP_AVAILABLE_IN_2_38
gboolean soup_session_would_redirect (SoupSession *session,
SoupMessage *msg);
SOUP_AVAILABLE_IN_2_38
gboolean soup_session_redirect_message (SoupSession *session,
SoupMessage *msg);
SOUP_AVAILABLE_IN_2_24
void soup_session_add_feature (SoupSession *session,
SoupSessionFeature *feature);
SOUP_AVAILABLE_IN_2_24
void soup_session_add_feature_by_type (SoupSession *session,
GType feature_type);
SOUP_AVAILABLE_IN_2_24
void soup_session_remove_feature (SoupSession *session,
SoupSessionFeature *feature);
SOUP_AVAILABLE_IN_2_24
void soup_session_remove_feature_by_type (SoupSession *session,
GType feature_type);
SOUP_AVAILABLE_IN_2_42
gboolean soup_session_has_feature (SoupSession *session,
GType feature_type);
SOUP_AVAILABLE_IN_2_26
GSList *soup_session_get_features (SoupSession *session,
GType feature_type);
SOUP_AVAILABLE_IN_2_26
SoupSessionFeature *soup_session_get_feature (SoupSession *session,
GType feature_type);
SOUP_AVAILABLE_IN_2_28
SoupSessionFeature *soup_session_get_feature_for_message(SoupSession *session,
GType feature_type,
SoupMessage *msg);
SOUP_AVAILABLE_IN_2_42
SoupRequest *soup_session_request (SoupSession *session,
const char *uri_string,
GError **error);
SOUP_AVAILABLE_IN_2_42
SoupRequest *soup_session_request_uri (SoupSession *session,
SoupURI *uri,
GError **error);
SOUP_AVAILABLE_IN_2_42
SoupRequestHTTP *soup_session_request_http (SoupSession *session,
const char *method,
const char *uri_string,
GError **error);
SOUP_AVAILABLE_IN_2_42
SoupRequestHTTP *soup_session_request_http_uri (SoupSession *session,
const char *method,
SoupURI *uri,
GError **error);
SOUP_AVAILABLE_IN_2_42
GQuark soup_request_error_quark (void);
#define SOUP_REQUEST_ERROR soup_request_error_quark ()
typedef enum {
SOUP_REQUEST_ERROR_BAD_URI,
SOUP_REQUEST_ERROR_UNSUPPORTED_URI_SCHEME,
SOUP_REQUEST_ERROR_PARSING,
SOUP_REQUEST_ERROR_ENCODING
} SoupRequestError;
SOUP_AVAILABLE_IN_2_50
void soup_session_websocket_connect_async (SoupSession *session,
SoupMessage *msg,
const char *origin,
char **protocols,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
SOUP_AVAILABLE_IN_2_50
SoupWebsocketConnection *soup_session_websocket_connect_finish (SoupSession *session,
GAsyncResult *result,
GError **error);
G_END_DECLS
#endif /* __SOUP_SESSION_H__ */
|