Commit cb2f7854 authored by Ignacio Casal Quinteiro's avatar Ignacio Casal Quinteiro
Browse files

Port more classes to the new private api

Now only SoupMessage is missing since the private from this class
is accessed from other classes.
parent efcb377d
......@@ -37,12 +37,6 @@
* Since: 2.40
**/
static void soup_multipart_input_stream_pollable_init (GPollableInputStreamInterface *pollable_interface, gpointer interface_data);
G_DEFINE_TYPE_WITH_CODE (SoupMultipartInputStream, soup_multipart_input_stream, G_TYPE_FILTER_INPUT_STREAM,
G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
soup_multipart_input_stream_pollable_init))
enum {
PROP_0,
......@@ -65,6 +59,13 @@ struct _SoupMultipartInputStreamPrivate {
goffset remaining_bytes;
};
static void soup_multipart_input_stream_pollable_init (GPollableInputStreamInterface *pollable_interface, gpointer interface_data);
G_DEFINE_TYPE_WITH_CODE (SoupMultipartInputStream, soup_multipart_input_stream, G_TYPE_FILTER_INPUT_STREAM,
G_ADD_PRIVATE (SoupMultipartInputStream)
G_IMPLEMENT_INTERFACE (G_TYPE_POLLABLE_INPUT_STREAM,
soup_multipart_input_stream_pollable_init))
static void
soup_multipart_input_stream_dispose (GObject *object)
{
......@@ -201,9 +202,7 @@ static void
soup_multipart_input_stream_init (SoupMultipartInputStream *multipart)
{
SoupMultipartInputStreamPrivate *priv;
priv = multipart->priv = G_TYPE_INSTANCE_GET_PRIVATE (multipart,
SOUP_TYPE_MULTIPART_INPUT_STREAM,
SoupMultipartInputStreamPrivate);
priv = multipart->priv = soup_multipart_input_stream_get_instance_private (multipart);
priv->meta_buf = g_byte_array_sized_new (RESPONSE_BLOCK_SIZE);
priv->done_with_part = FALSE;
......@@ -290,8 +289,6 @@ soup_multipart_input_stream_class_init (SoupMultipartInputStreamClass *multipart
GInputStreamClass *input_stream_class =
G_INPUT_STREAM_CLASS (multipart_class);
g_type_class_add_private (multipart_class, sizeof (SoupMultipartInputStreamPrivate));
object_class->dispose = soup_multipart_input_stream_dispose;
object_class->finalize = soup_multipart_input_stream_finalize;
object_class->constructed = soup_multipart_input_stream_constructed;
......
......@@ -34,12 +34,6 @@
* Deprecated: Use #SoupSession:proxy-resolver
*/
static void soup_proxy_resolver_default_interface_init (SoupProxyURIResolverInterface *proxy_resolver_interface);
G_DEFINE_TYPE_EXTENDED (SoupProxyResolverDefault, soup_proxy_resolver_default, G_TYPE_OBJECT, 0,
G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE, NULL)
G_IMPLEMENT_INTERFACE (SOUP_TYPE_PROXY_URI_RESOLVER, soup_proxy_resolver_default_interface_init))
enum {
PROP_0,
PROP_GPROXY_RESOLVER
......@@ -48,7 +42,13 @@ enum {
typedef struct {
GProxyResolver *gproxy_resolver;
} SoupProxyResolverDefaultPrivate;
#define SOUP_PROXY_RESOLVER_DEFAULT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_PROXY_RESOLVER_DEFAULT, SoupProxyResolverDefaultPrivate))
static void soup_proxy_resolver_default_interface_init (SoupProxyURIResolverInterface *proxy_resolver_interface);
G_DEFINE_TYPE_EXTENDED (SoupProxyResolverDefault, soup_proxy_resolver_default, G_TYPE_OBJECT, 0,
G_ADD_PRIVATE (SoupProxyResolverDefault)
G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE, NULL)
G_IMPLEMENT_INTERFACE (SOUP_TYPE_PROXY_URI_RESOLVER, soup_proxy_resolver_default_interface_init))
static void
soup_proxy_resolver_default_init (SoupProxyResolverDefault *resolver)
......@@ -59,7 +59,8 @@ static void
soup_proxy_resolver_default_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
SoupProxyResolverDefaultPrivate *priv = SOUP_PROXY_RESOLVER_DEFAULT_GET_PRIVATE (object);
SoupProxyResolverDefault *resolver = SOUP_PROXY_RESOLVER_DEFAULT (object);
SoupProxyResolverDefaultPrivate *priv = soup_proxy_resolver_default_get_instance_private (resolver);
switch (prop_id) {
case PROP_GPROXY_RESOLVER:
......@@ -76,7 +77,8 @@ soup_proxy_resolver_default_set_property (GObject *object, guint prop_id,
static void
soup_proxy_resolver_default_constructed (GObject *object)
{
SoupProxyResolverDefaultPrivate *priv = SOUP_PROXY_RESOLVER_DEFAULT_GET_PRIVATE (object);
SoupProxyResolverDefault *resolver = SOUP_PROXY_RESOLVER_DEFAULT (object);
SoupProxyResolverDefaultPrivate *priv = soup_proxy_resolver_default_get_instance_private (resolver);
if (!priv->gproxy_resolver) {
priv->gproxy_resolver = g_proxy_resolver_get_default ();
......@@ -89,7 +91,8 @@ soup_proxy_resolver_default_constructed (GObject *object)
static void
soup_proxy_resolver_default_finalize (GObject *object)
{
SoupProxyResolverDefaultPrivate *priv = SOUP_PROXY_RESOLVER_DEFAULT_GET_PRIVATE (object);
SoupProxyResolverDefault *resolver = SOUP_PROXY_RESOLVER_DEFAULT (object);
SoupProxyResolverDefaultPrivate *priv = soup_proxy_resolver_default_get_instance_private (resolver);
g_clear_object (&priv->gproxy_resolver);
......@@ -101,8 +104,6 @@ soup_proxy_resolver_default_class_init (SoupProxyResolverDefaultClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
g_type_class_add_private (klass, sizeof (SoupProxyResolverDefaultPrivate));
object_class->set_property = soup_proxy_resolver_default_set_property;
object_class->constructed = soup_proxy_resolver_default_constructed;
object_class->finalize = soup_proxy_resolver_default_finalize;
......@@ -178,7 +179,8 @@ get_proxy_uri_async (SoupProxyURIResolver *resolver,
SoupProxyURIResolverCallback callback,
gpointer user_data)
{
SoupProxyResolverDefaultPrivate *priv = SOUP_PROXY_RESOLVER_DEFAULT_GET_PRIVATE (resolver);
SoupProxyResolverDefault *resolver_default = SOUP_PROXY_RESOLVER_DEFAULT (resolver);
SoupProxyResolverDefaultPrivate *priv = soup_proxy_resolver_default_get_instance_private (resolver_default);
SoupAsyncData *async_data;
char *uri_string;
......@@ -211,7 +213,8 @@ get_proxy_uri_sync (SoupProxyURIResolver *resolver,
GCancellable *cancellable,
SoupURI **proxy_uri)
{
SoupProxyResolverDefaultPrivate *priv = SOUP_PROXY_RESOLVER_DEFAULT_GET_PRIVATE (resolver);
SoupProxyResolverDefault *resolver_default = SOUP_PROXY_RESOLVER_DEFAULT (resolver);
SoupProxyResolverDefaultPrivate *priv = soup_proxy_resolver_default_get_instance_private (resolver_default);
GError *error = NULL;
char** proxy_uris = NULL;
char *uri_string;
......
......@@ -38,17 +38,18 @@
* #SoupRequestData implements #SoupRequest for "data" URIs.
*/
G_DEFINE_TYPE (SoupRequestData, soup_request_data, SOUP_TYPE_REQUEST)
struct _SoupRequestDataPrivate {
gsize content_length;
char *content_type;
};
G_DEFINE_TYPE_WITH_PRIVATE (SoupRequestData, soup_request_data, SOUP_TYPE_REQUEST)
static void
soup_request_data_init (SoupRequestData *data)
{
data->priv = G_TYPE_INSTANCE_GET_PRIVATE (data, SOUP_TYPE_REQUEST_DATA, SoupRequestDataPrivate);
data->priv = soup_request_data_get_instance_private (data);
}
static void
......@@ -151,8 +152,6 @@ soup_request_data_class_init (SoupRequestDataClass *request_data_class)
SoupRequestClass *request_class =
SOUP_REQUEST_CLASS (request_data_class);
g_type_class_add_private (request_data_class, sizeof (SoupRequestDataPrivate));
request_class->schemes = data_schemes;
object_class->finalize = soup_request_data_finalize;
......
......@@ -40,8 +40,6 @@
* URIs.
*/
G_DEFINE_TYPE (SoupRequestFile, soup_request_file, SOUP_TYPE_REQUEST)
struct _SoupRequestFilePrivate {
GFile *gfile;
......@@ -49,10 +47,12 @@ struct _SoupRequestFilePrivate {
goffset size;
};
G_DEFINE_TYPE_WITH_PRIVATE (SoupRequestFile, soup_request_file, SOUP_TYPE_REQUEST)
static void
soup_request_file_init (SoupRequestFile *file)
{
file->priv = G_TYPE_INSTANCE_GET_PRIVATE (file, SOUP_TYPE_REQUEST_FILE, SoupRequestFilePrivate);
file->priv = soup_request_file_get_instance_private (file);
file->priv->size = -1;
}
......@@ -265,8 +265,6 @@ soup_request_file_class_init (SoupRequestFileClass *request_file_class)
SoupRequestClass *request_class =
SOUP_REQUEST_CLASS (request_file_class);
g_type_class_add_private (request_file_class, sizeof (SoupRequestFilePrivate));
request_class->schemes = file_schemes;
object_class->finalize = soup_request_file_finalize;
......
......@@ -44,13 +44,13 @@
* #SoupMessage.
*/
G_DEFINE_TYPE (SoupRequestHTTP, soup_request_http, SOUP_TYPE_REQUEST)
struct _SoupRequestHTTPPrivate {
SoupMessage *msg;
char *content_type;
};
G_DEFINE_TYPE_WITH_PRIVATE (SoupRequestHTTP, soup_request_http, SOUP_TYPE_REQUEST)
static void content_sniffed (SoupMessage *msg,
const char *content_type,
GHashTable *params,
......@@ -59,7 +59,7 @@ static void content_sniffed (SoupMessage *msg,
static void
soup_request_http_init (SoupRequestHTTP *http)
{
http->priv = G_TYPE_INSTANCE_GET_PRIVATE (http, SOUP_TYPE_REQUEST_HTTP, SoupRequestHTTPPrivate);
http->priv = soup_request_http_get_instance_private (http);
}
static gboolean
......@@ -203,8 +203,6 @@ soup_request_http_class_init (SoupRequestHTTPClass *request_http_class)
SoupRequestClass *request_class =
SOUP_REQUEST_CLASS (request_http_class);
g_type_class_add_private (request_http_class, sizeof (SoupRequestHTTPPrivate));
request_class->schemes = http_schemes;
object_class->finalize = soup_request_http_finalize;
......
......@@ -47,12 +47,6 @@
* Since: 2.42
*/
static void soup_request_initable_interface_init (GInitableIface *initable_interface);
G_DEFINE_TYPE_WITH_CODE (SoupRequest, soup_request, G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
soup_request_initable_interface_init))
enum {
PROP_0,
PROP_URI,
......@@ -64,10 +58,17 @@ struct _SoupRequestPrivate {
SoupSession *session;
};
static void soup_request_initable_interface_init (GInitableIface *initable_interface);
G_DEFINE_TYPE_WITH_CODE (SoupRequest, soup_request, G_TYPE_OBJECT,
G_ADD_PRIVATE (SoupRequest)
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
soup_request_initable_interface_init))
static void
soup_request_init (SoupRequest *request)
{
request->priv = G_TYPE_INSTANCE_GET_PRIVATE (request, SOUP_TYPE_REQUEST, SoupRequestPrivate);
request->priv = soup_request_get_instance_private (request);
}
static void
......@@ -271,8 +272,6 @@ soup_request_class_init (SoupRequestClass *request_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (request_class);
g_type_class_add_private (request_class, sizeof (SoupRequestPrivate));
request_class->check_uri = soup_request_default_check_uri;
request_class->send_async = soup_request_default_send_async;
request_class->send_finish = soup_request_default_send_finish;
......
......@@ -37,21 +37,19 @@ struct _SoupRequesterPrivate {
};
G_DEFINE_TYPE_WITH_CODE (SoupRequester, soup_requester, G_TYPE_OBJECT,
G_ADD_PRIVATE (SoupRequester)
G_IMPLEMENT_INTERFACE (SOUP_TYPE_SESSION_FEATURE,
soup_requester_session_feature_init))
static void
soup_requester_init (SoupRequester *requester)
{
requester->priv = G_TYPE_INSTANCE_GET_PRIVATE (requester,
SOUP_TYPE_REQUESTER,
SoupRequesterPrivate);
requester->priv = soup_requester_get_instance_private (requester);
}
static void
soup_requester_class_init (SoupRequesterClass *requester_class)
{
g_type_class_add_private (requester_class, sizeof (SoupRequesterPrivate));
}
static void
......
......@@ -118,8 +118,6 @@
* #GMainContext.
*/
G_DEFINE_TYPE (SoupServer, soup_server, G_TYPE_OBJECT)
enum {
REQUEST_STARTED,
REQUEST_READ,
......@@ -188,7 +186,6 @@ typedef struct {
gboolean disposed;
} SoupServerPrivate;
#define SOUP_SERVER_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_SERVER, SoupServerPrivate))
#define SOUP_SERVER_SERVER_HEADER_BASE "libsoup/" PACKAGE_VERSION
......@@ -211,6 +208,8 @@ enum {
LAST_PROP
};
G_DEFINE_TYPE_WITH_PRIVATE (SoupServer, soup_server, G_TYPE_OBJECT)
static SoupClientContext *soup_client_context_ref (SoupClientContext *client);
static void soup_client_context_unref (SoupClientContext *client);
......@@ -232,7 +231,7 @@ free_handler (SoupServerHandler *handler)
static void
soup_server_init (SoupServer *server)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
priv->handlers = soup_path_map_new ((GDestroyNotify)free_handler);
......@@ -247,7 +246,7 @@ static void
soup_server_dispose (GObject *object)
{
SoupServer *server = SOUP_SERVER (object);
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
priv->disposed = TRUE;
soup_server_disconnect (server);
......@@ -259,7 +258,7 @@ static void
soup_server_finalize (GObject *object)
{
SoupServer *server = SOUP_SERVER (object);
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
g_clear_object (&priv->legacy_iface);
......@@ -285,7 +284,7 @@ soup_server_finalize (GObject *object)
static gboolean
soup_server_ensure_listening (SoupServer *server)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
SoupSocket *listener;
if (priv->listeners)
......@@ -329,7 +328,7 @@ soup_server_constructor (GType type,
server = G_OBJECT_CLASS (soup_server_parent_class)->
constructor (type, n_construct_properties, construct_properties);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (SOUP_SERVER (server));
/* For backward compatibility, we have to process the
* :ssl-cert-file, :ssl-key-file, :interface, and :port
......@@ -409,7 +408,8 @@ static void
soup_server_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (object);
SoupServer *server = SOUP_SERVER (object);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
const char *header;
switch (prop_id) {
......@@ -477,7 +477,7 @@ soup_server_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec)
{
SoupServer *server = SOUP_SERVER (object);
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
switch (prop_id) {
case PROP_PORT:
......@@ -523,8 +523,6 @@ soup_server_class_init (SoupServerClass *server_class)
{
GObjectClass *object_class = G_OBJECT_CLASS (server_class);
g_type_class_add_private (server_class, sizeof (SoupServerPrivate));
/* virtual method override */
object_class->constructor = soup_server_constructor;
object_class->dispose = soup_server_dispose;
......@@ -975,7 +973,7 @@ soup_server_get_port (SoupServer *server)
SoupServerPrivate *priv;
g_return_val_if_fail (SOUP_IS_SERVER (server), 0);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
soup_server_ensure_listening (server);
g_return_val_if_fail (priv->legacy_iface != NULL, 0);
......@@ -1011,7 +1009,7 @@ soup_server_set_ssl_cert_file (SoupServer *server,
SoupServerPrivate *priv;
g_return_val_if_fail (SOUP_IS_SERVER (server), FALSE);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
if (priv->tls_cert)
g_object_unref (priv->tls_cert);
......@@ -1055,7 +1053,7 @@ soup_server_is_https (SoupServer *server)
SoupServerPrivate *priv;
g_return_val_if_fail (SOUP_IS_SERVER (server), 0);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
return priv->tls_cert != NULL;
}
......@@ -1081,7 +1079,7 @@ soup_server_get_listener (SoupServer *server)
SoupServerPrivate *priv;
g_return_val_if_fail (SOUP_IS_SERVER (server), NULL);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
soup_server_ensure_listening (server);
g_return_val_if_fail (priv->legacy_iface != NULL, NULL);
......@@ -1111,7 +1109,7 @@ soup_server_get_listeners (SoupServer *server)
GSList *listeners, *iter;
g_return_val_if_fail (SOUP_IS_SERVER (server), NULL);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
listeners = NULL;
for (iter = priv->listeners; iter; iter = iter->next)
......@@ -1182,7 +1180,7 @@ request_finished (SoupMessage *msg, SoupMessageIOCompletion completion, gpointer
{
SoupClientContext *client = user_data;
SoupServer *server = client->server;
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
SoupSocket *sock = client->sock;
gboolean failed;
......@@ -1224,7 +1222,7 @@ request_finished (SoupMessage *msg, SoupMessageIOCompletion completion, gpointer
static SoupServerHandler *
get_handler (SoupServer *server, SoupMessage *msg)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
SoupURI *uri;
uri = soup_message_get_uri (msg);
......@@ -1271,7 +1269,7 @@ static void
got_headers (SoupMessage *msg, SoupClientContext *client)
{
SoupServer *server = client->server;
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
SoupServerHandler *handler;
SoupURI *uri;
SoupDate *date;
......@@ -1417,7 +1415,7 @@ got_body (SoupMessage *msg, SoupClientContext *client)
static void
start_request (SoupServer *server, SoupClientContext *client)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
SoupMessage *msg;
soup_client_context_cleanup (client);
......@@ -1447,7 +1445,7 @@ start_request (SoupServer *server, SoupClientContext *client)
static void
socket_disconnected (SoupSocket *sock, SoupClientContext *client)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (client->server);
SoupServerPrivate *priv = soup_server_get_instance_private (client->server);
priv->clients = g_slist_remove (priv->clients, client);
......@@ -1461,7 +1459,7 @@ static void
soup_server_accept_socket (SoupServer *server,
SoupSocket *sock)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
SoupClientContext *client;
client = soup_client_context_new (server, sock);
......@@ -1550,7 +1548,7 @@ soup_server_run_async (SoupServer *server)
SoupSocket *listener;
g_return_if_fail (SOUP_IS_SERVER (server));
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
soup_server_ensure_listening (server);
......@@ -1591,7 +1589,7 @@ soup_server_run (SoupServer *server)
SoupServerPrivate *priv;
g_return_if_fail (SOUP_IS_SERVER (server));
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
if (!priv->loop) {
priv->loop = g_main_loop_new (priv->async_context, TRUE);
......@@ -1630,7 +1628,7 @@ soup_server_quit (SoupServer *server)
SoupSocket *listener;
g_return_if_fail (SOUP_IS_SERVER (server));
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
g_return_if_fail (priv->legacy_iface != NULL);
g_return_if_fail (priv->listeners != NULL);
......@@ -1666,7 +1664,7 @@ soup_server_disconnect (SoupServer *server)
SoupClientContext *client;
g_return_if_fail (SOUP_IS_SERVER (server));
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
if (priv->legacy_iface) {
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
......@@ -1716,7 +1714,7 @@ soup_server_listen_internal (SoupServer *server, SoupSocket *listener,
SoupServerListenOptions options,
GError **error)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
gboolean is_listening;
if (options & SOUP_SERVER_LISTEN_HTTPS) {
......@@ -1804,7 +1802,7 @@ soup_server_listen (SoupServer *server, GSocketAddress *address,
g_return_val_if_fail (!(options & SOUP_SERVER_LISTEN_IPV4_ONLY) &&
!(options & SOUP_SERVER_LISTEN_IPV6_ONLY), FALSE);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
g_return_val_if_fail (priv->disposed == FALSE, FALSE);
saddr = soup_address_new_from_gsockaddr (address);
......@@ -1828,7 +1826,7 @@ soup_server_listen_ipv4_ipv6 (SoupServer *server,
SoupServerListenOptions options,
GError **error)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
GSocketAddress *addr4, *addr6;
GError *my_error = NULL;
SoupSocket *v4sock;
......@@ -2033,7 +2031,7 @@ soup_server_listen_socket (SoupServer *server, GSocket *socket,
g_return_val_if_fail (!(options & SOUP_SERVER_LISTEN_IPV4_ONLY) &&
!(options & SOUP_SERVER_LISTEN_IPV6_ONLY), FALSE);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
g_return_val_if_fail (priv->disposed == FALSE, FALSE);
listener = g_initable_new (SOUP_TYPE_SOCKET, NULL, error,
......@@ -2083,7 +2081,7 @@ soup_server_listen_fd (SoupServer *server, int fd,
g_return_val_if_fail (!(options & SOUP_SERVER_LISTEN_IPV4_ONLY) &&
!(options & SOUP_SERVER_LISTEN_IPV6_ONLY), FALSE);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
g_return_val_if_fail (priv->disposed == FALSE, FALSE);
listener = g_initable_new (SOUP_TYPE_SOCKET, NULL, error,
......@@ -2129,7 +2127,7 @@ soup_server_get_uris (SoupServer *server)
gpointer creds;
g_return_val_if_fail (SOUP_IS_SERVER (server), NULL);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
for (l = priv->listeners, uris = NULL; l; l = l->next) {
listener = l->data;
......@@ -2172,7 +2170,7 @@ soup_server_get_async_context (SoupServer *server)
SoupServerPrivate *priv;
g_return_val_if_fail (SOUP_IS_SERVER (server), NULL);
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
return priv->async_context;
}
......@@ -2488,7 +2486,7 @@ soup_client_context_steal_connection (SoupClientContext *client)
static SoupServerHandler *
get_or_create_handler (SoupServer *server, const char *exact_path)
{
SoupServerPrivate *priv = SOUP_SERVER_GET_PRIVATE (server);
SoupServerPrivate *priv = soup_server_get_instance_private (server);
SoupServerHandler *handler;
exact_path = NORMALIZED_PATH (exact_path);
......@@ -2719,7 +2717,7 @@ soup_server_remove_handler (SoupServer *server, const char *path)
SoupServerPrivate *priv;
g_return_if_fail (SOUP_IS_SERVER (server));
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
soup_path_map_remove (priv->handlers, NORMALIZED_PATH (path));
}
......@@ -2747,7 +2745,7 @@ soup_server_add_auth_domain (SoupServer *server, SoupAuthDomain *auth_domain)
SoupServerPrivate *priv;
g_return_if_fail (SOUP_IS_SERVER (server));
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
priv->auth_domains = g_slist_append (priv->auth_domains, auth_domain);
g_object_ref (auth_domain);
......@@ -2766,7 +2764,7 @@ soup_server_remove_auth_domain (SoupServer *server, SoupAuthDomain *auth_domain)
SoupServerPrivate *priv;
g_return_if_fail (SOUP_IS_SERVER (server));
priv = SOUP_SERVER_GET_PRIVATE (server);
priv = soup_server_get_instance_private (server);
priv->auth_domains = g_slist_remove (priv->auth_domains, auth_domain);
g_object_unref (auth_domain);
......
......@@ -142,7 +142,6 @@ typedef struct {
GHashTable *request_types;
} SoupSessionPrivate;
#define SOUP_SESSION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), SOUP_TYPE_SESSION, SoupSessionPrivate))
#define SOUP_IS_PLAIN_SESSION(o) (G_TYPE_FROM_INSTANCE (o) == SOUP_TYPE_SESSION)
......@@ -168,7 +167,7 @@ static void async_send_request_running (SoupSession *session, SoupMessageQueueIt
#define SOUP_SESSION_USER_AGENT_BASE "libsoup/" PACKAGE_VERSION
G_DEFINE_TYPE (SoupSession, soup_session, G_TYPE_OBJECT)
G_DEFINE_TYPE_WITH_PRIVATE (SoupSession, soup_session, G_TYPE_OBJECT)
enum {
REQUEST_QUEUED,
...