gvfs r1222 - in trunk: . client common daemon



Author: alexl
Date: Mon Feb  4 09:57:27 2008
New Revision: 1222
URL: http://svn.gnome.org/viewvc/gvfs?rev=1222&view=rev

Log:
2008-02-04  Alexander Larsson  <alexl redhat com>

        * common/gvfsdaemonprotocol.h:
        * client/gdaemonfileinputstream.c:
        * client/gdaemonfileoutputstream.c:
        * daemon/gvfsreadchannel.c:
        * daemon/gvfswritechannel.c:
	Remove SEEK_CUR from channel protocol. This
	doesn't work with readahead, and can be converted
	to a SEEK_SET since we know the file position on
	the client side.




Modified:
   trunk/ChangeLog
   trunk/client/gdaemonfileinputstream.c
   trunk/client/gdaemonfileoutputstream.c
   trunk/common/gvfsdaemonprotocol.h
   trunk/daemon/gvfsreadchannel.c
   trunk/daemon/gvfswritechannel.c

Modified: trunk/client/gdaemonfileinputstream.c
==============================================================================
--- trunk/client/gdaemonfileinputstream.c	(original)
+++ trunk/client/gdaemonfileinputstream.c	Mon Feb  4 09:57:27 2008
@@ -1006,7 +1006,7 @@
 	case SEEK_STATE_INIT:
 	  request = G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_SET;
 	  if (op->seek_type == G_SEEK_CUR)
-	    request = G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_CUR;
+	    op->offset = file->current_offset + op->offset;
 	  else if (op->seek_type == G_SEEK_END)
 	    request = G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END;
 	  append_request (file, request,

Modified: trunk/client/gdaemonfileoutputstream.c
==============================================================================
--- trunk/client/gdaemonfileoutputstream.c	(original)
+++ trunk/client/gdaemonfileoutputstream.c	Mon Feb  4 09:57:27 2008
@@ -806,7 +806,7 @@
 	case SEEK_STATE_INIT:
 	  request = G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_SET;
 	  if (op->seek_type == G_SEEK_CUR)
-	    request = G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_CUR;
+	    op->offset = file->current_offset + op->offset;
 	  else if (op->seek_type == G_SEEK_END)
 	    request = G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END;
 	  append_request (file, request,

Modified: trunk/common/gvfsdaemonprotocol.h
==============================================================================
--- trunk/common/gvfsdaemonprotocol.h	(original)
+++ trunk/common/gvfsdaemonprotocol.h	Mon Feb  4 09:57:27 2008
@@ -107,9 +107,8 @@
 #define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_WRITE 1
 #define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_CLOSE 2
 #define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_CANCEL 3
-#define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_CUR 4
-#define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_SET 5
-#define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END 6
+#define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_SET 4
+#define G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END 5
 
 /*
 read, readahead reply:

Modified: trunk/daemon/gvfsreadchannel.c
==============================================================================
--- trunk/daemon/gvfsreadchannel.c	(original)
+++ trunk/daemon/gvfsreadchannel.c	Mon Feb  4 09:57:27 2008
@@ -159,14 +159,11 @@
 				      backend_handle,
 				      backend);
       break;
-    case G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_CUR:
     case G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END:
     case G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_SET:
       seek_type = G_SEEK_SET;
       if (command == G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END)
 	seek_type = G_SEEK_END;
-      else if (command == G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_CUR)
-	seek_type = G_SEEK_CUR;
       
       read_channel->read_count = 0;
       read_channel->seek_generation++;

Modified: trunk/daemon/gvfswritechannel.c
==============================================================================
--- trunk/daemon/gvfswritechannel.c	(original)
+++ trunk/daemon/gvfswritechannel.c	Mon Feb  4 09:57:27 2008
@@ -128,14 +128,11 @@
 				       backend_handle,
 				       backend);
       break;
-    case G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_CUR:
     case G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END:
     case G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_SET:
       seek_type = G_SEEK_SET;
       if (command == G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_END)
 	seek_type = G_SEEK_END;
-      else if (command == G_VFS_DAEMON_SOCKET_PROTOCOL_REQUEST_SEEK_CUR)
-	seek_type = G_SEEK_CUR;
       
       job = g_vfs_job_seek_write_new (write_channel,
 				      backend_handle,



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