From d79fe80cbda95c96252fb6bb09eaba4796b77e57 Mon Sep 17 00:00:00 2001 From: lace <> Date: Sun, 25 Dec 2005 16:52:37 +0000 Subject: [PATCH] +Optimization of neon "http" handler to avoid resetting connection on seek(). - Also pushed as: http://bugzilla.gnome.org/show_bug.cgi?id=324984 --- src/install/acquire/cabinet.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/install/acquire/cabinet.c b/src/install/acquire/cabinet.c index 57fa7af..3967631 100644 --- a/src/install/acquire/cabinet.c +++ b/src/install/acquire/cabinet.c @@ -127,6 +127,7 @@ GnomeVFSHandle *handle_new; struct sigaction oldact; int errint; struct itimerval itimerval; +GnomeVFSFileSize offset_current; if ((*ui_progress)(NULL)) return GNOME_VFS_ERROR_INTERRUPTED; @@ -149,7 +150,13 @@ struct itimerval itimerval; &itimerval, /* value */ NULL); /* ovalue */ g_assert(errint==0); - errvfsresult=gnome_vfs_seek(*acquire_cabinet->handlep,GNOME_VFS_SEEK_START,offset); + /* Optimization avoid resetting connection + * in neon "http" handler of: FC4 gnome-vfs2-2.10.0-5 + * http://bugzilla.gnome.org/show_bug.cgi?id=324984 + */ + errvfsresult=gnome_vfs_tell(*acquire_cabinet->handlep,&offset_current); + if (GNOME_VFS_OK==errvfsresult && (GnomeVFSFileOffset)offset_current!=offset) + errvfsresult=gnome_vfs_seek(*acquire_cabinet->handlep,GNOME_VFS_SEEK_START,offset); if (GNOME_VFS_OK==errvfsresult) errvfsresult=gnome_vfs_read(*acquire_cabinet->handlep,buffer,bytes,bytes_read); } -- 1.8.3.1