gvfs r1092 - in trunk: . daemon



Author: gicmo
Date: Thu Jan 10 23:04:48 2008
New Revision: 1092
URL: http://svn.gnome.org/viewvc/gvfs?rev=1092&view=rev

Log:
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.


Added:
   trunk/daemon/gvfsbackendhttp.c
   trunk/daemon/gvfsbackendhttp.h
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/daemon/Makefile.am

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Thu Jan 10 23:04:48 2008
@@ -51,6 +51,10 @@
 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 ****************************

Modified: trunk/daemon/Makefile.am
==============================================================================
--- trunk/daemon/Makefile.am	(original)
+++ trunk/daemon/Makefile.am	Thu Jan 10 23:04:48 2008
@@ -30,7 +30,7 @@
 %.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 @@
 	-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)

Added: trunk/daemon/gvfsbackendhttp.c
==============================================================================
--- (empty file)
+++ trunk/daemon/gvfsbackendhttp.c	Thu Jan 10 23:04:48 2008
@@ -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;
+
+}

Added: trunk/daemon/gvfsbackendhttp.h
==============================================================================
--- (empty file)
+++ trunk/daemon/gvfsbackendhttp.h	Thu Jan 10 23:04:48 2008
@@ -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__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]