[gvfs] http: Remove outdated sync methods
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] http: Remove outdated sync methods
- Date: Thu, 26 Nov 2015 13:42:35 +0000 (UTC)
commit 4302a595da3bece9ef89fb7342766f5a3c2ce256
Author: Ondrej Holy <oholy redhat com>
Date: Wed Sep 16 16:05:56 2015 +0200
http: Remove outdated sync methods
Async and sync methods differ one from other. Async methods have more
error checking. We don't need the sync methods, because http and dav
backends don't use them. Therefor remove the sync methods.
https://bugzilla.gnome.org/show_bug.cgi?id=754824
daemon/gvfshttpinputstream.c | 78 ------------------------------------------
daemon/gvfshttpinputstream.h | 4 --
2 files changed, 0 insertions(+), 82 deletions(-)
---
diff --git a/daemon/gvfshttpinputstream.c b/daemon/gvfshttpinputstream.c
index 5eafc29..1c6c11a 100644
--- a/daemon/gvfshttpinputstream.c
+++ b/daemon/gvfshttpinputstream.c
@@ -125,82 +125,6 @@ g_vfs_http_input_stream_ensure_request (GInputStream *stream)
return priv->req;
}
-/**
- * g_vfs_http_input_stream_send:
- * @stream: a #GVfsHttpInputStream
- * @cancellable: optional #GCancellable object, %NULL to ignore.
- * @error: location to store the error occuring, or %NULL to ignore
- *
- * Synchronously sends the HTTP request associated with @stream, and
- * reads the response headers. Call this after g_vfs_http_input_stream_new()
- * and before the first g_input_stream_read() if you want to check the
- * HTTP status code before you start reading.
- *
- * Return value: %TRUE if msg was successfully sent, %FALSE if not
- **/
-gboolean
-g_vfs_http_input_stream_send (GInputStream *stream,
- GCancellable *cancellable,
- GError **error)
-{
- GVfsHttpInputStreamPrivate *priv;
-
- g_return_val_if_fail (G_VFS_IS_HTTP_INPUT_STREAM (stream), FALSE);
- priv = G_VFS_HTTP_INPUT_STREAM_GET_PRIVATE (stream);
-
- if (priv->stream)
- return TRUE;
-
- if (!g_input_stream_set_pending (stream, error))
- return FALSE;
- g_vfs_http_input_stream_ensure_request (stream);
- priv->stream = soup_request_send (priv->req, cancellable, error);
- g_input_stream_clear_pending (stream);
-
- return priv->stream != NULL;
-}
-
-static gssize
-g_vfs_http_input_stream_read (GInputStream *stream,
- void *buffer,
- gsize count,
- GCancellable *cancellable,
- GError **error)
-{
- GVfsHttpInputStreamPrivate *priv = G_VFS_HTTP_INPUT_STREAM_GET_PRIVATE (stream);
- gssize nread;
-
- if (!priv->stream)
- {
- g_vfs_http_input_stream_ensure_request (stream);
- priv->stream = soup_request_send (priv->req, cancellable, error);
- if (!priv->stream)
- return -1;
- }
-
- nread = g_input_stream_read (priv->stream, buffer, count, cancellable, error);
- if (nread > 0)
- priv->offset += nread;
- return nread;
-}
-
-static gboolean
-g_vfs_http_input_stream_close (GInputStream *stream,
- GCancellable *cancellable,
- GError **error)
-{
- GVfsHttpInputStreamPrivate *priv = G_VFS_HTTP_INPUT_STREAM_GET_PRIVATE (stream);
-
- if (priv->stream)
- {
- if (!g_input_stream_close (priv->stream, cancellable, error))
- return FALSE;
- g_clear_object (&priv->stream);
- }
-
- return TRUE;
-}
-
static void
send_callback (GObject *object,
GAsyncResult *result,
@@ -590,8 +514,6 @@ g_vfs_http_input_stream_class_init (GVfsHttpInputStreamClass *klass)
gobject_class->finalize = g_vfs_http_input_stream_finalize;
- stream_class->read_fn = g_vfs_http_input_stream_read;
- stream_class->close_fn = g_vfs_http_input_stream_close;
stream_class->read_async = g_vfs_http_input_stream_read_async;
stream_class->read_finish = g_vfs_http_input_stream_read_finish;
stream_class->close_async = g_vfs_http_input_stream_close_async;
diff --git a/daemon/gvfshttpinputstream.h b/daemon/gvfshttpinputstream.h
index eb8acb0..bce0c88 100644
--- a/daemon/gvfshttpinputstream.h
+++ b/daemon/gvfshttpinputstream.h
@@ -57,10 +57,6 @@ GType g_vfs_http_input_stream_get_type (void) G_GNUC_CONST;
GInputStream *g_vfs_http_input_stream_new (SoupSession *session,
SoupURI *uri);
-gboolean g_vfs_http_input_stream_send (GInputStream *stream,
- GCancellable *cancellable,
- GError **error);
-
void g_vfs_http_input_stream_send_async (GInputStream *stream,
int io_priority,
GCancellable *cancellable,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]