diff options
author | Dan Winship <danw@src.gnome.org> | 2003-08-14 15:02:32 +0000 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2003-08-14 15:02:32 +0000 |
commit | 3601be883b932a7b3167ad39cc786a16fd68b834 (patch) | |
tree | e8204b11977a14312ce8240ec7806dfb3849691b /libsoup/soup-connection.h | |
parent | ee5e4f227dbd85e40b2e510f0390d57c690525d4 (diff) | |
download | libsoup-3601be883b932a7b3167ad39cc786a16fd68b834.tar.gz |
New, split out from soup-context and made into a GObject.
* libsoup/soup-connection.c: New, split out from soup-context and
made into a GObject.
(soup_connection_disconnect): Disconnects the connection and emits
a signal. (Replaces the old "keep_alive" flag.)
(soup_connection_is_connected): Checks if the connection is still
connected
(connection_died): Just disconnect, rather than freeing the
connection. This way if anyone else is still referencing it they
won't end up with an invalid pointer.
* libsoup/soup-context.c: Make this a GObject, remove all the
SoupConnection code. Add an "ntlm_auths" field to SoupHost so that
SoupContext can keep track of connection auth stuff there without
SoupConnection needing to care. Various other updates.
* libsoup/soup-private.h: Remove SoupContext and SoupConnection
definitions.
* libsoup/*.c, tests/get.c: Update for context/connection changes
* libsoup/soup-socks.c (soup_connect_socks_proxy): Change the
definition to deal with the fact that there's no
soup_connection_get_context any more.
* libsoup/soup-queue.c (soup_queue_read_headers_cb): Don't deal
with connection persistence here.
(soup_queue_read_done_cb): Do it here instead. Disconnect the
connection when appropriate.
(proxy_connect, proxy_https_connect, proxy_https_connect_cb):
Reference-count the connection properly. (I think.)
* libsoup/soup-marshal.list: New, for SoupConnection's
"disconnected" signal.
* libsoup/Makefile.am: add rules to build soup-marshal.[ch]
* configure.in: Use AM_PATH_GLIB_2 rather than pkg-config, so that
GLIB_GENMARSHAL gets set too.
Diffstat (limited to 'libsoup/soup-connection.h')
-rw-r--r-- | libsoup/soup-connection.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/libsoup/soup-connection.h b/libsoup/soup-connection.h new file mode 100644 index 00000000..70d4d4ca --- /dev/null +++ b/libsoup/soup-connection.h @@ -0,0 +1,54 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * Copyright (C) 2000-2003, Ximian, Inc. + */ + +#ifndef SOUP_CONNECTION_H +#define SOUP_CONNECTION_H 1 + +#include <time.h> + +#include <glib-object.h> +#include <libsoup/soup-socket.h> + +#define SOUP_TYPE_CONNECTION (soup_connection_get_type ()) +#define SOUP_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SOUP_TYPE_CONNECTION, SoupConnection)) +#define SOUP_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SOUP_TYPE_CONNECTION, SoupConnectionClass)) +#define SOUP_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SOUP_TYPE_CONNECTION)) +#define SOUP_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), SOUP_TYPE_CONNECTION)) +#define SOUP_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SOUP_TYPE_CONNECTION, SoupConnectionClass)) + +typedef struct SoupConnectionPrivate SoupConnectionPrivate; + +typedef struct { + GObject parent; + + SoupConnectionPrivate *priv; +} SoupConnection; + +typedef struct { + GObjectClass parent_class; + + /* signals */ + void (*disconnected) (SoupConnection *); +} SoupConnectionClass; + +GType soup_connection_get_type (void); + + +SoupConnection *soup_connection_new (SoupSocket *sock); +void soup_connection_start_ssl (SoupConnection *conn); +void soup_connection_disconnect (SoupConnection *conn); +gboolean soup_connection_is_connected (SoupConnection *conn); + +GIOChannel *soup_connection_get_iochannel (SoupConnection *conn); + +void soup_connection_set_in_use (SoupConnection *conn, + gboolean in_use); +gboolean soup_connection_is_in_use (SoupConnection *conn); +time_t soup_connection_last_used (SoupConnection *conn); + +gboolean soup_connection_is_new (SoupConnection *conn); +void soup_connection_mark_old (SoupConnection *conn); + +#endif /*SOUP_CONNECTION_H*/ |