[arch-commits] CVS update of extra/gnome/gnome-vfs (2 files)

Jan de Groot jgc at archlinux.org
Fri Mar 21 21:46:52 UTC 2008


    Date: Friday, March 21, 2008 @ 17:46:52
  Author: jgc
    Path: /home/cvs-extra/extra/gnome/gnome-vfs

   Added: http-neon-method-youtube.patch (1.1)
Modified: PKGBUILD (1.53 -> 1.54)

upgpkg: gnome-vfs 2.22.0-2
    Fix http-neon-method to work with broken servers (youtube)


--------------------------------+
 PKGBUILD                       |    9 ++--
 http-neon-method-youtube.patch |   80 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 86 insertions(+), 3 deletions(-)


Index: extra/gnome/gnome-vfs/PKGBUILD
diff -u extra/gnome/gnome-vfs/PKGBUILD:1.53 extra/gnome/gnome-vfs/PKGBUILD:1.54
--- extra/gnome/gnome-vfs/PKGBUILD:1.53	Mon Mar 10 19:08:22 2008
+++ extra/gnome/gnome-vfs/PKGBUILD	Fri Mar 21 17:46:51 2008
@@ -1,9 +1,9 @@
-# $Id: PKGBUILD,v 1.53 2008/03/10 23:08:22 jgc Exp $
+# $Id: PKGBUILD,v 1.54 2008/03/21 21:46:51 jgc Exp $
 # Maintainer: Jan de Groot <jgc at archlinux.org>
 
 pkgname=gnome-vfs
 pkgver=2.22.0
-pkgrel=1
+pkgrel=2
 pkgdesc="The GNOME Virtual File System"
 arch=(i686 x86_64)
 license=('LGPL')
@@ -16,7 +16,8 @@
 url="http://www.gnome.org"
 install=gnome-vfs.install
 source=(http://ftp.gnome.org/pub/gnome/sources/${pkgname}/2.22/gnome-vfs-${pkgver}.tar.bz2
-	hal-show-volume-names.patch)
+	hal-show-volume-names.patch
+	http-neon-method-youtube.patch)
 md5sums=('369105fd82cb99e69e63acab8f3b89b7'
          '109d07aa1dc8cb6523c47c4984047dce')
 
@@ -25,6 +26,8 @@
   #Archlinux patch (b.g.o #321498)
   patch -Np1 -i ${startdir}/src/hal-show-volume-names.patch || return 1
 
+  patch -Np1 -i ${startdir}/src/http-neon-method-youtube.patch || return 1
+
   ./configure --prefix=/usr --sysconfdir=/etc \
         --localstatedir=/var --disable-static \
 	--libexecdir=/usr/lib/gnome-vfs-2.0 \
Index: extra/gnome/gnome-vfs/http-neon-method-youtube.patch
diff -u /dev/null extra/gnome/gnome-vfs/http-neon-method-youtube.patch:1.1
--- /dev/null	Fri Mar 21 17:46:52 2008
+++ extra/gnome/gnome-vfs/http-neon-method-youtube.patch	Fri Mar 21 17:46:52 2008
@@ -0,0 +1,80 @@
+--- trunk/modules/http-neon-method.c	2008/02/15 05:17:33	5446
++++ trunk/modules/http-neon-method.c	2008/03/21 11:21:39	5467
+@@ -1773,6 +1773,25 @@
+ 	return GNOME_VFS_OK;
+ }
+ 
++static gboolean
++http_context_host_matches (HttpContext *context, const char *glob)
++{
++        GnomeVFSToplevelURI *uri;
++        GPatternSpec *spec;
++        gboolean res;
++
++        uri = gnome_vfs_uri_get_toplevel (context->uri);
++
++        if (uri == NULL ||  uri->host_name == NULL || glob == NULL)
++                return FALSE;
++
++        spec = g_pattern_spec_new (glob);
++        res = g_pattern_match_string (spec, uri->host_name);
++        g_pattern_spec_free (spec);
++
++        return res;
++}
++
+ static GnomeVFSResult
+ http_follow_redirect (HttpContext *context)
+ {
+@@ -2255,7 +2274,7 @@
+ 	hctx = handle->context;
+ 	
+ get_start:	
+-	req  = ne_request_create (hctx->session, "GET", hctx->path);
++	req = ne_request_create (hctx->session, "GET", hctx->path);
+ 	
+ 	if (handle->use_range) {
+ 		
+@@ -2330,8 +2349,8 @@
+ 
+ 		handle->transfer_state = TRANSFER_READ;
+ 		handle->transfer.read = req;
+-	}
+-	
++	} 
++
+ 	return result;
+ }
+ 
+@@ -2347,6 +2366,20 @@
+ 	return GNOME_VFS_ERROR_INTERNAL;
+ }
+ 
++/* TRUE means we can range, ie server is sane, FALSE means FAIL */
++static gboolean
++i_can_haz_range_cause_serverz_not_br0ken (HttpContext *hctx)
++{
++        gboolean br0ken = FALSE;
++
++        if (http_context_host_matches (hctx, "*youtube.*")) {
++                DEBUG_HTTP ("Youtube detected! Cannot use ranged gets");
++                br0ken = TRUE;
++        }
++
++        return br0ken == FALSE;
++}
++
+ /* ************************************************************************** */
+ 
+ static GnomeVFSResult
+@@ -2402,8 +2435,8 @@
+ 			return result;
+ 		} 
+ 	} else {
+-                /* Always try to make Ranged puts */
+-		handle->use_range = TRUE;
++		handle->use_range = i_can_haz_range_cause_serverz_not_br0ken (hctx);
++                DEBUG_HTTP ("Use range: %s\n", handle->use_range ? "on" : "off");
+ 	}
+ 
+ 	result = http_transfer_start (handle);	




More information about the arch-commits mailing list