diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | daemon/Makefile.am | 16 | ||||
-rw-r--r-- | daemon/gvfsbackendhttp.c | 87 | ||||
-rw-r--r-- | daemon/gvfsbackendhttp.h | 50 |
5 files changed, 165 insertions, 1 deletions
@@ -1,3 +1,12 @@ +2008-01-11 Christian Kellner <gicmo@gnome.org> + + * configure.ac: + * daemon/Makefile.am: + * daemon/gvfsbackendhttp.c: + * daemon/gvfsbackendhttp.h: + Initial attempt of writing the http backend. Not much + there yet only a stub. + 2008-01-10 Alexander Larsson <alexl@redhat.com> * daemon/gvfsbackend.h: diff --git a/configure.ac b/configure.ac index 60d3afb7..97571068 100644 --- a/configure.ac +++ b/configure.ac @@ -51,6 +51,10 @@ AC_ARG_WITH(dbus_service_dir, [ --with-dbus-service-dir=PATH choose directory f DBUS_SERVICE_DIR=$with_dbus_service_dir AC_SUBST(DBUS_SERVICE_DIR) +PKG_CHECK_MODULES(HTTP, libsoup-2.2) +AC_SUBST(HTTP_CFLAGS) +AC_SUBST(HTTP_LIBS) + dnl **************************** dnl *** Checks for intltool *** dnl **************************** diff --git a/daemon/Makefile.am b/daemon/Makefile.am index 7bef73b0..c8baea38 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -30,7 +30,7 @@ service_DATA = gvfs-daemon.service %.mount: %.mount.in ../config.log sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@ -libexec_PROGRAMS=gvfsd gvfsd-ftp gvfsd-sftp gvfsd-trash gvfsd-computer gvfsd-localtest +libexec_PROGRAMS=gvfsd gvfsd-ftp gvfsd-sftp gvfsd-http gvfsd-trash gvfsd-computer gvfsd-localtest mount_in_files = ftp.mount.in sftp.mount.in trash.mount.in computer.mount.in localtest.mount.in mount_DATA = ftp.mount sftp.mount trash.mount computer.mount localtest.mount @@ -219,3 +219,17 @@ gvfsd_cdda_CPPFLAGS = \ -DBACKEND_TYPES='"cdda", G_VFS_TYPE_BACKEND_CDDA,' gvfsd_cdda_LDADD = $(libraries) $(CDDA_LIBS) + +gvfsd_http_SOURCES = \ + gvfsbackendhttp.c gvfsbackendhttp.h \ + daemon-main.c daemon-main.h \ + daemon-main-generic.c + +gvfsd_http_CPPFLAGS = \ + -DBACKEND_HEADER=gvfsbackendhttp.h \ + -DDEFAULT_BACKEND_TYPE=http \ + -DMAX_JOB_THREADS=1 \ + $(HTTP_CFLAGS) \ + -DBACKEND_TYPES='"http", G_VFS_TYPE_BACKEND_HTTP,' + +gvfsd_http_LDADD = $(libraries) $(HTTP_LIBS) diff --git a/daemon/gvfsbackendhttp.c b/daemon/gvfsbackendhttp.c new file mode 100644 index 00000000..98d2a533 --- /dev/null +++ b/daemon/gvfsbackendhttp.c @@ -0,0 +1,87 @@ +/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2008 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Christian Kellner <gicmo@gnome.org> + */ + +#include <config.h> + +#include <sys/types.h> +#include <sys/stat.h> +#include <errno.h> +#include <unistd.h> +#include <fcntl.h> +#include <string.h> + +#include <glib/gstdio.h> +#include <glib/gi18n.h> +#include <gio/gio.h> + +#include <libsoup/soup.h> + +#include "gvfsbackendhttp.h" +#include "gvfsjobopenforread.h" +#include "gvfsjobread.h" +#include "gvfsjobseekread.h" +#include "gvfsjobopenforwrite.h" +#include "gvfsjobwrite.h" +#include "gvfsjobseekwrite.h" +#include "gvfsjobsetdisplayname.h" +#include "gvfsjobqueryinfo.h" +#include "gvfsjobqueryfsinfo.h" +#include "gvfsjobqueryattributes.h" +#include "gvfsjobenumerate.h" +#include "gvfsdaemonprotocol.h" + + +struct _GVfsBackendHttp +{ + GVfsBackend parent_instance; + + SoupSession *session; +}; + +G_DEFINE_TYPE (GVfsBackendHttp, g_vfs_backend_http, G_VFS_TYPE_BACKEND); + +static void +g_vfs_backend_http_finalize (GObject *object) +{ + GVfsBackendHttp *backend; + + backend = G_VFS_BACKEND_HTTP (object); + + if (G_OBJECT_CLASS (g_vfs_backend_http_parent_class)->finalize) + (*G_OBJECT_CLASS (g_vfs_backend_http_parent_class)->finalize) (object); +} + +static void +g_vfs_backend_http_init (GVfsBackendHttp *backend) +{ +} + +static void +g_vfs_backend_http_class_init (GVfsBackendHttpClass *klass) +{ + GObjectClass *gobject_class = G_OBJECT_CLASS (klass); + GVfsBackendClass *backend_class = G_VFS_BACKEND_CLASS (klass); + + gobject_class->finalize = g_vfs_backend_http_finalize; + +} diff --git a/daemon/gvfsbackendhttp.h b/daemon/gvfsbackendhttp.h new file mode 100644 index 00000000..24751376 --- /dev/null +++ b/daemon/gvfsbackendhttp.h @@ -0,0 +1,50 @@ +/* GIO - GLib Input, Output and Streaming Library + * + * Copyright (C) 2008 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + * + * Author: Christian Kellner <gicmo@gnome.org> + */ + +#ifndef __G_VFS_BACKEND_HTTP_H__ +#define __G_VFS_BACKEND_HTTP_H__ + +#include <gvfsbackend.h> +#include <gmountspec.h> + +G_BEGIN_DECLS + +#define G_VFS_TYPE_BACKEND_HTTP (g_vfs_backend_http_get_type ()) +#define G_VFS_BACKEND_HTTP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_VFS_TYPE_BACKEND_HTTP, GVfsBackendHttp)) +#define G_VFS_BACKEND_HTTP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_VFS_TYPE_BACKEND_HTTP, GVfsBackendHttpClass)) +#define G_VFS_IS_BACKEND_HTTP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_VFS_TYPE_BACKEND_HTTP)) +#define G_VFS_IS_BACKEND_HTTP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_VFS_TYPE_BACKEND_HTTP)) +#define G_VFS_BACKEND_HTTP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_VFS_TYPE_BACKEND_HTTP, GVfsBackendHttpClass)) + +typedef struct _GVfsBackendHttp GVfsBackendHttp; +typedef struct _GVfsBackendHttpClass GVfsBackendHttpClass; + +struct _GVfsBackendHttpClass +{ + GVfsBackendClass parent_class; +}; + +GType g_vfs_backend_http_get_type (void) G_GNUC_CONST; + +G_END_DECLS + +#endif /* __G_VFS_BACKEND_HTTP_H__ */ |