GNOME Bugzilla – Bug 121194
seek() support for 'http' vfs module
Last modified: 2004-12-22 21:47:04 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).
Created attachment 19648 [details] [review] Patch to implement it.
GNOME 2.4 is currently deeply frozen, the patch will have to wait until 2.5 development starts
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
Jan, Can you attach an updated patch? I would like to test the patch. Thanks.
Created attachment 20683 [details] [review] Current patch from 'cvs rdiff' - rdiff source preferred.
I have tested the patch and it works well. It would be good if someone can review it.
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.
> 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).
If you don't have time to do it, I can take care of it
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.
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 :)
Created attachment 20930 [details] [review] Cleaned up patch wrt init()/clear() vs. new()/destroy()
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
Teuf?
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.
The new neon http backend should support seeks.