summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@users.sourceforge.net>2004-05-02 16:33:23 +0000
committerBastien Nocera <hadess@users.sourceforge.net>2004-05-02 16:33:23 +0000
commit31302cafb189b486b3fb0eca4fd98081bc10cf37 (patch)
tree1ae7d053aed70f1452c272b3ed28e572450644e7
parentd67de10fc236de2f3a67ae6c237756c7deca14de (diff)
downloadxine-lib-31302cafb189b486b3fb0eca4fd98081bc10cf37.tar.gz
xine-lib-31302cafb189b486b3fb0eca4fd98081bc10cf37.tar.bz2
- work around the gnome-vfs sftp: method having a max read size of 256k
(Closes: #140401) CVS patchset: 6474 CVS date: 2004/05/02 16:33:23
-rw-r--r--src/input/input_gnome_vfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/input/input_gnome_vfs.c b/src/input/input_gnome_vfs.c
index 34f9a4056..3d8accfcd 100644
--- a/src/input/input_gnome_vfs.c
+++ b/src/input/input_gnome_vfs.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_gnome_vfs.c,v 1.19 2004/03/01 00:22:31 hadess Exp $
+ * $Id: input_gnome_vfs.c,v 1.20 2004/05/02 16:33:23 hadess Exp $
*/
@@ -71,6 +71,8 @@ gnomevfs_plugin_get_capabilities (input_plugin_t *this_gen)
return INPUT_CAP_SEEKABLE | INPUT_CAP_SPULANG;
}
+#define SSH_BUFFER_SIZE 256 * 1024
+
static off_t
gnomevfs_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
{
@@ -86,7 +88,7 @@ gnomevfs_plugin_read (input_plugin_t *this_gen, char *buf, off_t len)
GnomeVFSResult res;
res = gnome_vfs_read (this->fh, &buf[num_bytes],
- (GnomeVFSFileSize) (len - num_bytes),
+ (GnomeVFSFileSize) MIN (len - num_bytes, SSH_BUFFER_SIZE),
(GnomeVFSFileSize *)&n);
D("gnomevfs_plugin_read: read %ld from gnome-vfs",