After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 121194 - seek() support for 'http' vfs module
seek() support for 'http' vfs module
Status: RESOLVED FIXED
Product: gnome-vfs
Classification: Deprecated
Component: Module: http
cvs (head)
Other All
: High enhancement
: 2.6
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
Depends on:
Blocks:
 
 
Reported: 2003-09-01 16:50 UTC by Jan Kratochvil
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch to implement it. (19.80 KB, patch)
2003-09-01 16:51 UTC, Jan Kratochvil
none Details | Review
Current patch from 'cvs rdiff' - rdiff source preferred. (19.54 KB, patch)
2003-10-14 04:40 UTC, Jan Kratochvil
needs-work Details | Review
Cleaned up patch wrt init()/clear() vs. new()/destroy() (13.68 KB, patch)
2003-10-25 09:06 UTC, Jan Kratochvil
none Details | Review
Patch updated to work with the latest changes in CVS. (14.22 KB, patch)
2004-04-22 20:02 UTC, Alexander Boström
none Details | Review

Description Jan Kratochvil 2003-09-01 16:50:54 UTC
Implement seek() and tell() for http:// files.
Use HTTP/1.1 "Range" header to implement it.
Big seek ranges will close and open new GET connection.
As we do a new make_request() during such restart we need to keep its
original (HttpFileHandle *) address as it is also GnomeVFSMethodHandle.
We no longer allocate/free it - we just fill/clear its memory block instead.
TODO: WRITE streams seek() operation (simple as it is offline).
Comment 1 Jan Kratochvil 2003-09-01 16:51:45 UTC
Created attachment 19648 [details] [review]
Patch to implement it.
Comment 2 Christophe Fergeau 2003-09-02 08:14:12 UTC
GNOME 2.4 is currently deeply frozen, the patch will have to wait
until 2.5 development starts
Comment 3 Jan Kratochvil 2003-09-02 21:33:14 UTC
Some bugfix, the attachment "09/01/03 12:51 - Patch to implement it."
is no longer valid.
The latest complete diff for possible future patch integration:
cvs -z3 -d :pserver:pserver:@cvs.jankratochvil.net:/cvs rdiff -r
bp_captive -r captive -u gnome-vfs-httpcaptive/modules/http-method.c

Regards,
Jan Kratochvil
Comment 4 Manuel Clos 2003-10-13 21:48:38 UTC
Jan,

Can you attach an updated patch? I would like to test the patch.

Thanks.
Comment 5 Jan Kratochvil 2003-10-14 04:40:17 UTC
Created attachment 20683 [details] [review]
Current patch from 'cvs rdiff' - rdiff source preferred.
Comment 6 Manuel Clos 2003-10-14 21:55:26 UTC
I have tested the patch and it works well.

It would be good if someone can review it.
Comment 7 Christophe Fergeau 2003-10-19 12:33:23 UTC
I'm a bit confused about the changes in the way handles are
allocated/freed. Wouldn't have it been possible to add
http_file_handle_init/http_file_handle_clear functions which would
take care of initializing and clearing a handle without
allocating/freeing the handle itself, and then call those functions
from http_file_handle_new/http_file_handle_destroy, and from your seek
code?
In the current patch, http_file_handle_new and
http_file_handle_destroy should be renamed to init/clear anyway, and
create_handle to something like init_handle I think since they no
longer alloc/free memory. 
Please use g_new0 when creating the handles.
Comment 8 Jan Kratochvil 2003-10-19 12:43:58 UTC
> Wouldn't have it been possible to add
> http_file_handle_init/http_file_handle_clear functions which would
> take care of initializing and clearing a handle without
> allocating/freeing the handle itself, and then call those functions
> from http_file_handle_new/http_file_handle_destroy, and from your
> seek code?

Yes, you are right, this naming would be better.


> Please use g_new0 when creating the handles.

I expect it just as a general suggestion to prevent bogus content.
I am not aware it would change any functionality of the current patch.
I respect it as a good general approach despite its performance hit.


The patch was developed in a time constraint. Suggestions accepted, to
be implemented in the following days (works4me now).
Comment 9 Christophe Fergeau 2003-10-19 15:45:20 UTC
If you don't have time to do it, I can take care of it
Comment 10 Jan Kratochvil 2003-10-19 15:51:28 UTC
Currently no time for it.
I would not forget to do it as I appreciate the possible ChangeLog credit.
Patch it yourself if you like it, I would not like to roadblock it.
Comment 11 Christophe Fergeau 2003-10-19 17:59:58 UTC
I'm not really in a hurry to get this one in, actually it will
probably wait until after the 2.5.0 release since I have other stuff I
want to get in. I was a bit worried of having patches lying in
bugzilla without being reviewed, that's why I started to deal with
them this week end :)
Comment 12 Jan Kratochvil 2003-10-25 09:06:13 UTC
Created attachment 20930 [details] [review]
Cleaned up patch wrt init()/clear() vs. new()/destroy()
Comment 13 Jan Kratochvil 2003-11-29 17:18:01 UTC
I would appreciate possible patch import or specific reject as my
maintained separate 'http' forked tree is a bit pain for users.
Thanks,
Jan Kratochvil
Comment 14 Luis Villa 2004-02-14 05:24:08 UTC
Teuf?
Comment 15 Alexander Boström 2004-04-22 20:02:06 UTC
Created attachment 26979 [details] [review]
Patch updated to work with the latest changes in CVS.

This is based on a diff extracted from cvs.jankratochvil.net, with a few
rejects fixed. Almost no testing done, I've only run gnomevfs-cat.
Comment 16 Alexander Larsson 2004-08-25 14:52:02 UTC
The new neon http backend should support seeks.